Hacker News new | ask | show | jobs
by edanm 5779 days ago
After a few years of teaching new recruits how to program, this still amazes me: so many people will go a day without compiling once!

I mean, I've been programming professionally for 7 years, and much more before. But whenever I need to do something that I haven't done in the last week or so, I still always start with a tiny function to make sure I still remember how to do even the basic stuff, and build from there. E.g., every time I write some new js code, I start with a function that only prints something to the console; then, does the basic functionality, printing results to console; then and only then, start doing more complex things. It always surprises me that people will spend a day or more working without checking even the most basic check that what they're doing works the way they expect.

4 comments

>After a few years of teaching new recruits how to program, this still amazes me: so many people will go a day without compiling once!

I can go a long time without compiling but that's because I use IDE tools that show me instantly if I have compiler errors, etc. :)

This is without a doubt a huge benefit of IDEs (and compiled languages, since with interpreted you don't really get the same benefit). I wish more people realized how great the benefit of this: I suspect most people dismiss it without ever trying.
But they can't show you if you have logic errors. The more code you write without testing it, the harder it is to test.
This is the normal way that I write code. But sometimes I feel really confident and write a couple hundred lines without compiling. Then it's always fun to find out - did everything "just work" or did I omit something?
That's pretty much exactly what I do too- I'll start with maybe 10-15 lines before testing. I don't know why ANYONE would go a day without compiling or running
coding is very different kind of task, requiring a very different sort of approach, to the kinds of tasks most people are familiar with. most other tasks are no way near as exacting, etc. we are creatures of habit, we approach new tasks with the kinds of approaches we are familiar with using, and it simply takes time to learn how to approach programming.