Skip to content

Instantly share code, notes, and snippets.

@StephanTLavavej
Last active January 16, 2024 16:10
Show Gist options
  • Star 23 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save StephanTLavavej/e3037fafab2f446d14e65056418f8e24 to your computer and use it in GitHub Desktop.
Save StephanTLavavej/e3037fafab2f446d14e65056418f8e24 to your computer and use it in GitHub Desktop.
How and Why to Become a Programmer

How and Why to Become a Programmer

Audience

If you're starting your career (especially if you're in high school or college), or if you're thinking about changing your career, this is meant for you. (It's also possible to learn programming as a hobby, or as a complementary skill for a day job in a different field.)

Author

Hi, I'm Stephan T. Lavavej. I've worked at Microsoft for 15 years, on the C++ Standard Library for almost 13 years. These are my thoughts (not speaking for my employer), drawn from my own career experience. While there are many things that I don't have direct experience with, hopefully this will be useful.

Why Learn Programming?

If you don't know any programmers in person, you might be unfamiliar with what they do every day. (I wanted to be a scientist until I stumbled into this field, and I certainly didn't know what I was getting into.) "Programmers teach computers how to do things" is very abstract. Specific jobs vary, but I'd summarize the general reasons as:

  • Amplify your impact: It's difficult to phrase this without sounding silly, but a key insight is that software can do its work endlessly, because it can be copied or transmitted while consuming virtually no material resources. Many things can't be done with software, but for things that can, this makes a big difference.

  • Programming can be surprisingly fun: It turns out that getting computers to do things (and do them efficiently) involves solving many different kinds of puzzles. Solving puzzles, whether simple or difficult, can be satisfying. (Personally, this is what keeps me interested in programming. The fun that I had working with floating-point numbers can't be described in words.)

  • Money: It can be exchanged for goods and services, and programmers can earn a lot of money (reliably). Without getting into details, I think this needs to be emphasized: in the US, "everyone knows" that doctors are well-paid, but this isn't as widely known about programming because it's a newer profession (and the industry has been changing rapidly). This is a totally valid reason for a career choice (although it may not be great as a sole reason).

  • There's a ton of stuff to do: This field is vast, and still growing. Just listing all of the major areas where people can work would take a while, but you can look around and see how much of daily life involves code. There's even more code needed for manufacturing, banking, and other business processes that you can't directly see. Once you've learned how to program, translating your skills over to another language, tech area, or business domain is easier - so you can follow your interests.

There are many potential careers out there. If you want to be a doctor, a financial planner, a chemical engineer, or whatever, go for it. The world still needs jobs other than coders. But if you think that computers, smartphones, and the things that people do with them could be interesting, consider programming.

Other Things to Consider

I dislike lists of "myths", so here's a list of things that I believe to be true:

  • Programming doesn't require lots of "math" (in general). Especially the "math" that's taught in high school. There are some areas of programming that are math-heavy (e.g. 3D graphics, machine learning, floating-point). But most programming just involves addition, subtraction, multiplication, and division (including remainder). Bitwise operations are sometimes relevant, but seem to be fairly easy to learn. Many of the "math" topics in school that give people trouble (often due to years of horrible curriculum design, not the fault of students), like calculus, are completely absent in most programming. And I say this as someone who loved math in school and was excellent at it - most of it was simply not useful in my career. If you also liked math, great. If you didn't, please consider programming anyways - it's probably not what you're imagining. Programming does stress being able to think methodically (if thing A happens, then I need to deal with thing B), including thinking about what happens to numbers with elementary school operations performed on them, but it's not "math". Really.

  • A bachelor's degree in computer science is sufficient. At this time, if you want to find a programming job, the "best" degree to have is a bachelor's in computer science (despite the fact that CS isn't synonymous with programming, and in fact involves very different things), in terms of how easy it is to convince employers that you're qualified enough to be worth interviewing. It is absolutely possible to have a successful career without a college degree, or a degree in a field other than CS, but (again at this time) I believe that it is a more difficult, less certain path. Conversely, a master's degree or PhD is unnecessary in most areas. (There are some exceptions, e.g. machine learning, where PhDs and non-CS degrees can be extremely valuable.) I mention this because it is "obvious" to programmers, but it is not obvious to people familiar with other fields (the value of a bachelor's degree in other fields varies wildly).

  • If you don't have/want a BS in CS, Lambda School is probably your best bet. Like everything else, this is my personal opinion. Lambda School is a startup that trains people as programmers in exchange for income share agreements. I haven't used them, and I'm unaffiliated with them, but they seem to be doing all of the right things, with the right incentives. Consider them if the classical track doesn't seem to be right for you. (I would, if my degree and experience were erased, leaving only my desire to become a programmer, and if I had to make the choice in 2019 instead of 2002.) You can still find a programming job being entirely self-taught, with a sufficiently impressive portfolio, but it's more difficult.

  • Programming isn't in serious danger of being automated, outsourced, or oversaturated. Predictions are hard, but these are mine! These are different concerns. Programming will be the last job to be automated away - for when computers can program themselves, the human era will have ended. If you think all of the programming jobs will move elsewhere, the last decade of the tech industry should be a useful counterexample. And as for "oversaturation", the industry as a whole isn't a finite source of jobs that can dry up. Instead, the more programmers there are, everyone can become more specialized, there are more people whose work you can build on (including via open source) and who can consume your work, and more industries can be enhanced with software - increasing the demand that makes the system go. (For example, my job is extremely specialized - I work on C++ Standard Library algorithms and data structures, producing nothing myself, but my code is used by programmers in a vast variety of products and services. In turn, I build on top of the C Standard Library, the compiler front-end, back-end, and the operating system and hardware.)

  • People from any background can become programmers. Men can be nurses. Women can be astronauts. One-eyed mutants can be programmers. Don't let anyone tell you that "you don't look like a programmer".

How to Learn Programming

My advice here is less specific because I learned how to program a long time ago, in an environment that no longer exists.

  1. Choose a programming language. You can, and almost certainly will, learn other languages in your career, so your first choice isn't that critical. You should look for something that's actively being used (so you can ask people for help, use existing libraries of code, and use it in future jobs), that's suited to things you're interested in, and that seems approachable. Your first choice might not be a good one, and that's okay; if you start to notice problems with those areas, try something else. I switched from C to C++ after realizing that a simple language doesn't necessarily make programming simpler.

  2. Set up a programming environment. This depends on the language you're using; if you're learning C++, you might set up Microsoft Visual Studio Community on Windows, but if you're learning JavaScript, you'll be running your code in a completely different way.

  3. Choose a text editor. This can either be an IDE (Integrated Development Environment) like Visual Studio, or a standalone text editor like Visual Studio Code (which I use), or anything else that can edit plain text. Different people have different (often strong) preferences. Don't use Notepad, though; it isn't powerful enough.

  4. Write and run your first program, Hello World. This is the hardest step, because you have to figure out how to get that (often complicated) environment working. Everything after this point can be learned incrementally. Ask for help from someone who knows what they're doing if you get stuck (not necessarily an expert; even another beginner who's gotten past this point can help).

  5. Find a good book to learn the basics of the language. Unfortunately, not all books are good, so you should do a little research. For C++, "Programming: Principles and Practice Using C++, Second Edition" by Bjarne Stroustrup is a good choice. You'll need more books later, but once you learn the basics, you'll be able to evaluate how useful a book is yourself.

  6. Write programs. Write programs. Write programs! Aside from getting past Hello World, I think that this is the part that many beginners struggle with. Writing different kinds of small programs that you increasingly understand is how you build up skill. Then you can start writing larger programs that do more interesting things, and learn new skills (mostly, how to avoid programs collapsing under the weight of their own complexity; it is the ultimate skill). What your programs do doesn't really matter as a beginner, any more than the topics of your writing assignments in school mattered. They should be interesting enough to hold your attention, simple enough for you to understand, complicated enough to stress learning new patterns and language features, and (ideally) testable, so you can easily judge if you're writing correct code. I learned how to program by writing data compression algorithms, which were suited to my interests.

  7. You will make mistakes. Pay attention and learn how to avoid them. Programming is difficult to learn. Stuff won't work, or it'll work but you have no idea why, or it'll work but slowly. Some of this will be other people's fault (building upon unreliable technology, or bad design decisions years ago that have been hard to change), but most of it will be caused by the fact that your brain is human, small, and slow, and you're working with machines that can store trillions of bits and perform trillions of computations per second. Programmers have developed techniques to deal with this complexity, but you have to notice when your programs aren't working, what kind of code patterns are prone to bugs, and how to avoid them.

  8. Learn how to use a version control system. In 2019, this means learning the basics of git. This is important, even when your programs are fairly small and you're working alone, so you can keep track of what you're changing. (I didn't use version control until I started working, and it made my learning more difficult.)

There are many other things you'll need to learn, but this is a rough guide to get started. I hope it'll be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment