Ask HN: How can I learn to code in a practical environment?
University has so far taught me how to write algorithms, how to document code, and plenty of valuable abstract concepts. When I graduate, I'm estimated to be worth 80k.
But I don't know how to code. Sure, I can go into C++ and write a graph algorithm to do x or y, but as soon as I start trying to write a program that might be useful to someone, I find myself switching between Google and a blank screen for several hours, maybe writing a few lines here or there but eventually giving up entirely.
I want to learn, but I have no idea where to start. All of my experience is formal and all of my theoretical knowledge feels wasted because the only way I can implement it is to have someone else do it for me. I've tried internet tutorials but so far I've just felt stuck.
What are some steps I can take to reverse the situation?
10 comments
[ 3.2 ms ] story [ 34.1 ms ] threadYou might start with small projects. You may be able to find some online course which walks you through making small projects (rather than the typical algorithm stuff).
There are many, many areas of programming and no course will cover them all, or even one wholly. You just work on new stuff and you will retain what you use frequently. This knowledge gets more vast the more you code.
Exactly.
This is what works for me: 1) get general understanding of problem to solve 2) break it into steps or pieces 3) code pieces
Now, 2) might (hell, might? probably will!) reveal step 1) wasn't complete, so go back and improve your understanding, then move back to 2)
Over time you develop the ability to do a 'top down' approach like this, while also having a parallel 'brain space' that considers application architecture, customer requirements, good programming practices and so on.
Besides this 'concept of programming' (which is very personal, I'm just sharing how it works for me after ~20 years), don't give up and don't feel overwhelmed. In my experience, except for very rare 'super-programmers', good software is developed slowly, steadily, and built up one solid piece at a time. Break your 'useful program' down into pieces, and celebrate the achievement of developing (and testing!) each piece.
It gets easier (and then harder, but it gets easier first). :^)
This is normal for anyone who codes, even the pros and experts. So do not sweat over this thing.
Now, on the question of how to code/learn, I suggest you start with a small target/end goal. For example, "Build User management system" or anything like that. Then, pick a language of your choice and start coding. While you do that, you will google 100s of things, read stackoverflow plenty of times and bang your head on the screen as well. But at the end, you will be happy when that code finally compiles and run successfully or you don't get a 500 error in the web app. Stick to that project, finish it off no matter how small it seems like. You will learn a lot in the process. I am doing exactly that right now with web programming/dev. using Python/Flask framework. Last night, I learnt the best way to generate user activation links and how to use them. Simple stuff but I learnt like 10 things doing this alone.