capr / blag

:suspect: Blog/wiki of a grumpy old programmer
4 stars 0 forks source link

Advice for young programmers #32

Open capr opened 1 year ago

capr commented 1 year ago

Here's 10 random tips for beginner programmers:

  1. Start a serious project that you'd actually want to build if you were competent. You can do a Tetris at first or Space Invaders, but that's just a warm-up, it won't get you anywhere all by itself.

  2. Give it time. A serious project is like writing a book. It may take years. It can have a lengthy research phase. You need to develop a theme, a story arc, characters, etc. For an experienced programmer it may be more like building a house: they did it before so they already know the phases of construction, available building materials and how to work with them, etc. You don't know any of that. Give it time. Beginners tend to underestimate how long anything takes in this field, and then give up when they find out.

  3. Break down the problem into smaller problems, until a problem is small enough that you know how to solve. If you don't know how to solve a problem, then it's not broken down enough. This will never fail you.

  4. Only solve one problem at a time. If you feel confused, it means you're juggling too many things in your head the same time. Offloading them on paper and picking them up again one by one also helps.

  5. Rewire your brain on the concept of failure. Failure is good. It means you tried, and you learned something. Once you failed, and tried something else and that also failed, that's not a repeat failure, because you failed at a different thing, so you actually did good again, but it's easy to register that as doing bad. The worst thing you can do is to attach these failures to your self/ego/identity, i.e. to evaluate whether you're a good programmer or not based on them. Doing that will only add a psychological cost to trying again, making you over-cautious and ultimately dogmatic in your beliefs. Don't make it hard for you to say "I don't know".

  6. Beware of silver bullets. In this field which is fundamentally about thinking, you will discover things that will blow your mind. You'll fall in love with big ideas, and fall into the trap of thinking that they can solve all your problems for you. Your first love will probably be OOP. It will take years before OOP will disappoint you enough to want to try something else. Big ideas have power. There is truth in them, but they are not the truth.

  7. Develop radical skepticism. On the Internet, everybody's trying to sell you something, and it's usually a bad product. A lot of bad tech is considered good, both old and new. There's also more bad advice out there than there is good (and ChatGPT was trained on all of that). The masses will lead you astray. Think for yourself and follow no one.

  8. Learn how the computer works. That doesn't mean studying cache coherency protocols or x86 instruction packing. But even in JavaScript adding to a flat array is orders of magnitude faster than allocating objects all over the place. Learn the basics of RAM and CPU. You will never use map() and reduce() again, despite what people say on Stack Overflow.

  9. Don't be afraid to ask for help or to help people back. In my experience, more people are willing to help than they are being asked for help. Not everybody is an effective helper, sure, but the cost of triage is low. And if you think you have nothing you can help back a seasoned programmer with, then you haven't heard of rubberducking. Many times just explaining their problem to someone is all a programmer needs to get unstuck. My girlfriend is sick of it. As a programmer though, you might enjoy the conversation, and might even learn something.

  10. If you don't like it, then you don't like it. Barring variations in temperament, I actually don't think that people are naturally aligned to specific fields. I think that people tend to like whatever they are good at. Satisfaction grows along with competence because it's the exercise of competence that is the source of satisfaction. That said, if you gave programming an honest good shot and you found that you still can't get excited about it after a good amount of trying, then maybe you should stop torturing yourself and try something else. You can always get back to it later.