5 ms·
Ask HN: What advice would you give yourself if you were learning how to code?
- Eridrus 9y agoFind a task you want to accomplish with code and let that guide your learning.
- ZenoArrow 9y agoYes, that's exactly what I'd say too. The number of people who think they need to absorb everything before they write a single line of code is quite high. Forget all that. Write the simplest program you can, even a hello world, and get it to compile and run. Now add or change something, compile and run. Did it work as you thought it would? Then continue. If something went wrong, then Google is your friend. Search for answers, ask other programmers, make notes on the language as you go. Only after you've made a few mistakes, read a book, because you'll have some prior knowledge to give it context and make it stick. That's what works for me anyway.
- tmaly 9y agoStretch your ability and pick a project or challenge just out of your reach. This will help you learn and grow. Learn basics like command line, version control, how to use a editor productively. Built good habits early, learn from experienced developers. Read some Kent Beck or Robert Martin books.
- humbleMouse 9y agoLearn database design and functionality before coding. Things like primary keys and foreign keys. If you understand database design then object oriented programming is a cake walk.
- WheelsAtLarge 9y agoCode everyday and look for projects that stretch your knowledge - even if it's just a copy of something else. Don't fall into the camp that says that languages are cool. They are not. Languages are created to serve a purpose so make sure the one you use is meeting your needs. Learn regular expressions well since they are incredibly useful. I use them every day.
- vbuwivbiu 9y agoOne thing I learned from a colleague years ago is: Delete code. If a function isn't working after say 10 minutes of trying, delete it and write it from scratch. Another thing: walk away, come back, bug fixed. And the other one: explain code to a friend or yourself