This is list of things I wish that someone had told me as I was first starting to learn to code. There were a lot of places where I got hung up or thought I was doing something wrong during that process, that turned out to have been relatively simple once I did know them. This list is definitely incomplete, and probably inaccurate in places, so feel free to post additions or corrections in the comments.
- If you don’t know where to start, start with a scripting language. Python or Ruby are the standouts here; once you know one you’ll be able to pick up the other, so don’t worry about which too much. The important thing is that you be able to create programs by creating a file in a text editor and run them from the command line.
- Find a website that can teach you the basics– something where you write a bit of code and it gives you feedback immediately. I recommend Code Academy but there are a lot of options. Find one that clicks for you.
- There are a lot of very important things about coding that this website won’t teach you, like how to get a program running on your own computer.
- Get a copy of Notepad++ (Windows) or Sublime (Mac)
- Installing your chosen scripting language may be surprisingly hard the first time. You’ll get the hang of it, but you may run into problems that you haven’t learned yet how to diagnose. If you get stuck, find someone who’s done it before to help you.
- Get a reference book to your chosen language and its standard library, and never be afraid to look up how to do even simple things. The best programmers I know regularly look things up– coding is not about memorization.
- That said, it’s worth getting a sense of what your language’s standard library does so you can go “oh, I bet there’s a standard string method for this, lemme go look that up” when you need to.
- If you’re working on a Mac, get Homebrew. Package managers will make your life easier. If you’re working on Windows, consider learning how to use VirtualBox to run a Linux VM, for the same reason.
- Find someone who you can ask questions about definitions. There’s a ton of implicit knowledge in programming that people who already have it take for granted. Also, programmers are often bad at naming and describing things.
- Your $PATH variable is just a list of places that the operating system looks when it receives a command, (like “python <filename>”) for an executable that executes that command. Just add stuff to it. It doesn’t have to be elegant, and as long as you don’t delete anything you won’t break anything.
- A “dependency” is a “a thing that if it changes might break the system I’m talking about.”
- A “stack” is “the collection of different technologies that make up this application.”
- An “environment” is “the things that code might interact with or depend on in the system that it’s running on.” “Setting up a development environment” means “installing tools and configuring settings on my computer so that I can write code more easily.”
- An “API” is “the method that a system or library gives to other systems for using its internal commands.” A coding language itself is an API of sorts, for giving instructions to the language’s implementation, and that implementation in turn uses the operating system’s API to give commands to the host system’s CPU, hard drive, and so on.
- At some point, get either virtualenv (Python) or rvm (Ruby). These let you tie your project to a specific version of the language, and then to install libraries only for that project. You won’t need them immediately, but when you start working on projects that use multiple libraries, and sharing them with other people, they will make your life easier.
- You don’t need a framework to make a simple website. There’s a way in your language of choice to install a simple web server and write a few lines of code that will make it serve HTML, CSS, and Javascript files from a particular folder.
- You can do a lot of web stuff with just HTML, CSS, and plain Javascript, and it’s worth learning to do.
- You will do a lot of debugging by inspecting the values of objects and printing the results to the console. This is fine and good.
- Learn TDD. Better yet, find someone who can pair with you to get better at TDD.
- Learning to read API documentation is hard. It will get easier once you’ve done it a lot, and once you start writing similar code yourself.
- One of the best ways to learn to code better is to read other people’s code. Even better, read it, run it, and then make changes to it and run it again. (Of course, learning how to do all of that is an exercise in itself.)
- It’s okay to write code the simple way, rather than the clever way. When you read code that takes a lot of work to figure out how to read, that doesn’t always mean that the person who wrote it is a better programmer than you, even if it’s doing something cool.