“Failure is the opportunity to begin again more intelligently”
– (probably) Henry Ford
What an ominous way to start a blog post, talking about failure!
But let’s be real: “Understand and accept that you will make mistakes” is the First Commandment of Egoless Programming for a reason.
You will make mistakes.
And you know what? That’s cool. Because the second commandment is “You are not your code.”
I’ve been helping beginner programmers for the last five months (longer if you count the folks I wasn’t getting paid to help), and there are a few things that come up over and over.
Here are the tips I give beginners:
1. See above
That thing I said about making mistakes and it being okay?
That’s tip #1.
2. Run it early & often
It’s a very good idea to test tiny bits of code as you write it – it’s a trick that beginners often don’t use but experts rely on.
Make sure you run the code after every tiny change, as opposed to making 2+ changes and then running it. With the former, you know exactly the effect of the change, with the latter it becomes unclear what effects (or bugs) each change had on the program.
See my post about the importance of being methodical.
3. Just try it
Related to tip 2.
Often the best approach to simply try out a theory and then see what happens. Talking or wondering about it doesn’t give you any extra data points to use in making a decision.
Sometimes something seems “too easy.” Don’t psych yourself out, just try the seemingly-easy way and see if it works or not.
3. Google is your friend
For some reason, I see a lot of beginners say something like, “I really wanted to try to do this without using any resources.” I appreciate your pluck, kid, but people with 20 years of experience google things and look up documentation every day.
I suspect this attitude is a kind of legacy of our educational system. No cheating..?
Not only does documentation only exist for the sake of being used by people who don’t already have the answer (a fact sometimes forgotten by the writers of the documentation), but as long as you actually understand why a bit of code works, there’s not really much point to reinventing the wheel or floundering for no reason. No one programs using punch cards anymore, ’cause we’ve got other problems to solve.
As an example, I’m pretty sure that on StackOverflow, someone has asked every possible question about basic CSS stuff. A Google search will get that answer in front of you, fast.
Caveat: don’t just copy/paste stuff you don’t understand. After all, it is possible to delete everything from your computer with one little line of code.
4. Make cheatsheets
Creating a cheatsheet can be super useful. This is especially important if you’re learning more than one language at once because they will start to run together in your head.
Personally, when I’m learning something new I make a Note (comes with Macs – gotta love that search feature) for each language, framework, whatever, as a quick reference for little syntax things that I always forget. I also like to include links to the actually-helpful resources I find along the way.
5. Make it easy
Some beginners have the impulse to make it easier on themselves and sometimes other beginners find that annoying. But this is absolutely the right approach to take.
Stuff like being explicit with your variable names takes extra time, and it’s worth every second.
6. Make sure you read and understand the instructions
Wait, I thought this post was only 5 tips?
And then, when you think you’re done, double check before you move on. This is not only important for something like a homework assignment but also for meeting requirements out in the real world.
Hell, it’s good advice no matter what you’re doing.