TL/DR : for me programming is a way of thinking with a problem solving attitude, making sure to simplify the problem as much as possible.
Ask HN: What's was the hardest part about starting to code?
11–20 of 42 posts
Re: Ask HN: What's was the hardest part about starting to code?
#12Syntax comes pretty quickly, but it's the precision that is hard. So, for example, even writing a simple loop. Are you going to start at zero? Are you going to start at one? Should your loop condition be at the top of the loop, or at the bottom? Do you know what each of those implies about how many times the body of the loop will be executed? Do you check the termination condition with less than, equal to, or both? Are you sure the loop will terminate? Really sure? Do you know at what point any variables declared inside the loop are initialized, or re-initialized? Are you adjusting the loop variable inside the loop body in a way that is going to mess with the loop termination?
Programmers think of things like loop pre-conditions, post-conditions, and loop invariants to help them keep track of what they are doing, but beginners don't usually have tools like this that help them run the code in their heads while writing it to help ensure it will do what they intended.
As an example of just how easy this is to screw up, consider examples of unintended infinite loops:
https://en.wikipedia.org/wiki/Infinite_loop#Examples_of_unin...
Re: Ask HN: What's was the hardest part about starting to code?
#13Sometimes you get bugs that just are real headscratchers. This happens at the beginning of your career, at the end, and all the way through. There's some subtle thing keeping your code from working, even though you've gone through all the guides, stack overflow, and code review you can handle. Examples of issues like this are bugs in other people's code, library incompatibilities, timing issues, and generally trying to do anything.
You really need a lot of patience and a good problem solving attitude to solve these problems and keep going. Some people are lucky and look more productive because they don't run into these problems as often (though they do run into them). But you learn a lot more by solving these issues and understanding random parts of the stack.
To do this you really need to understand the entire system and use your tools. You need to understand things like how the OS might be doing things, how memory works, how threads work, how drivers work, etc.
If you just sit there and get frustrated, you can put in all the time in the world and not come up with the solution. You need an engineering/builder mentality right from the start, IMHO.
Re: Ask HN: What's was the hardest part about starting to code?
#14* Learning tools (they get in the way of solving the problem at the beginning imo)
* Incomplete/inaccurate documentation
* Not knowing what things are possible (both in code a la standard libraries or language features and working with tools like debuggers)
* Not knowing simple best practices until you're bit by something and find them out through a slow, painful discovery process
Re: Ask HN: What's was the hardest part about starting to code?
#15Re: Ask HN: What's was the hardest part about starting to code?
#16These auxiliary abstractions were the hardest for me. Where "is" my the data in my database? Isn't it all files at the end of the day? Why can't I just use files? What does "stateless" mean in the context of HTTP, when clearly something is remembered when I log in? Circa 2009, why not do everything in JavaScript? (Ha!)
Re: Ask HN: What's was the hardest part about starting to code?
#17I would argue that it's thinking programmatically and applying that mindset to a computer. When humans interact with each other there is a lot of subtlety and nuance that is embedded in that communication. I can say something to you but you can infer that I really mean the opposite by the tone of my communication. All that is lost with computers, when communicating with a computer you need to be especially precise in…
Re: Ask HN: What's was the hardest part about starting to code?
#18I learned 20+ years ago and I feel like back then it was a lot easier to learn. You would get a VB or C++ book and immerse yourself in it. The book would be self-contained --it had all the information you needed to become decent at that topic. Once you were done, you moved to the next book. If I was learning today, I think that I would be completely overwhelmed by the amount of information that we have at our disposa…
Re: Ask HN: What's was the hardest part about starting to code?
#19Being frustrated about something that no one can help you with. Sometimes you get bugs that just are real headscratchers. This happens at the beginning of your career, at the end, and all the way through. There's some subtle thing keeping your code from working, even though you've gone through all the guides, stack overflow, and code review you can handle. Examples of issues like this are bugs in other people's code,…
Re: Ask HN: What's was the hardest part about starting to code?
#20For me it was the vast number of things that you (eventually) need to know, many of which are assumed by those writing tutorials, such as 1. how to use the command line 2. how to `build from source` 3. how to integrate different technologies (such as the MEAN stack) 4. etc. In addition to the above, certain parts of the web, like StackOverflow, can be uninviting to new people even though (in my experience) the vast m…