Live data from Hacker News

Ask HN: What habits made you a better programmer?

news.ycombinator.com

81–90 of 103 posts

Re: Ask HN: What habits made you a better programmer?

#81
post #20

Taking a nap. Seriously, the most difficult problems I've faced have been solved easily just after taking a quick nap (30 - 40 mins). Most of the time it comes to the point that there's no solutions in the horizon, I'm pulling my hair out and biting on my keyboard and then, a quick nap later most of the problem is solved in 20 mins when I sit in front of my computer again. It's got probably something to do with uncon…

Actually by taking a nap you are doing something really cool. Let me explain: You are actually inviting your right hemisphere(the creative side of your brain) to come out and play. The right hemisphere cannot be forced into thinking that much so by taking a nap you are actually letting the unconscious work for you. As a really interesting side note, Thomas Edison used to take a nap whenever faced a difficult problem.…

I've heard this left-brain right-brain stuff before and I'd like to know where it comes from. Do you have any sources you can link to?

Re: Ask HN: What habits made you a better programmer?

#82
Reading.

Programming is 10% writing code, and 90% reading code. Reading your own code (debugging, refactoring, coming back to something you wrote on Friday on Monday), and reading other code ("why doesn't this library work?").

Once you learn to read, a number of things happen. You are no longer a slave to your libraries; you can open them up, see exactly what they're doing, and either change your mental model or change the code. You don't have to get stressed out about "coding guidelines" anymore, because you actually understand what the code means. Inane details like tabs versus spaces and cuddled elses or whatever don't matter anymore, because you have seen all the possible combinations. And, you pick up the style of your peers, because you aren't coding in a vacuum anymore.

I could go on and on, but if I boil it down to one action item, it's "when you have a problem with a library, read it". Everything else comes from there. (And before you know it, you'll be mentioned in the Changelog of everything you use! Good for getting your next job.)

Re: Ask HN: What habits made you a better programmer?

#84
1. Learning to love learning new languages. I have a few pet projects which are slightly longer than hello world that I practice with.

2. Accepting that code I wrote a month ago sucks. If it doesn't then I haven't improved/developed. That's really the point of refactoring. I do my best today and move on.

3. Socializing. Yes, going out to hack/codefests etc. makes you better. BTW: Yes, you have to speak with other people/developers...sitting in the corner by yourself and drinking your latte is usually not enough.

Re: Ask HN: What habits made you a better programmer?

#85
post #5

Three things: learning one editor (Emacs) really well, learning new languages that force me to think differently, and as am6100 said, writing a lot of programs.

I've used emacs for 9 years. Last week, on a whim, I went cold turkey to vim. The result: I'm probably staying with a (heavily modded) vim. I added the standard bash/emacs/OS X input keybindings to insertion mode. It feels like the best of both worlds. The moral: it's good to branch out and try new things every now and then. You might get surprised.

I went the other way this year and am now almost totally in Emacs. I recommend trying the vimpulse package for Emacs if you ever want to come back to the dark side.

Re: Ask HN: What habits made you a better programmer?

#86
post #66

Participating in programming competitions like IOI, ACM, Topcoder, GCJ, etc

How does that help? To me they seem like interesting puzzles, but with little relevance to problems in practical projects.

Those improves your coding ability a lot. For example, If your application needs to scale well, you should always consider implementing efficient algorithms. Yes, you can use some open source libraries, tools, etc but someone has to write those using efficient algorithms. This is one of the main reasons, that companies like Facebook, Google are recruiting people using these "puzzles" or contests like Topcoder, Google Codejam.

Re: Ask HN: What habits made you a better programmer?

#87
While I get my hands on a new technical book, I keep all the new terms and concepts that show up in a Google Docs document, just a list of them. Every now and then I take a peek at such list. It helps me increase and/or reinforce my knowledge around the area.

Before committing anything, I double-check everything, refactoring the code I have modified/added. This is easy because, once you have your new functionality or fix working, maintaining the new correct behavior as you modify the code is low-risk if you do it step by step.

English, as being my second language, is an important part of my job. I try to read all the books, blogs, movies, and so on in English. Every time I come across a new word, I look it up in wordreference (plugin for chrome), and add it to a list in Sidenote (mac app). When I need to communicate through email, I sift through that list looking for words that may fit in my message. It is a simple practice that has helped me out big time in uplifting my skills (of course I share this list with my friends!). Certainly this not directly related to programmig but, as I see it, if you want to improve as a programmer, you're going to need to become rather fluent in English.

Writing a blog. Especially invaluable when you get feedback of your posts. Folks out there shall give you a kick in the ass more often than you expect. Expect and embrace them. It's a great way to grow up.

Get to know that the finest blogs, books and people are in your domain. For example, years ago I programmed in Java, usually building web sites with the help of very known frameworks (Spring, Struts, you name it). I thought I was quite competent until I come across a book called "Effective Java" by a dude named Joshua Bloch. Needless to say I was struck by it and I ended up feeling like I knew nothing (literally). You can't program in Java and at the same time not know who Bloch, Goetz, Unble Bob, and so on. Same with Lisp and Norvig, Siebel, Graham.

I always strive to keep up with the basics. This is the killer skill that shines when everything else I try fails. With a new technology, starting out learning the ropes from the top abstraction layers makes me feel competent because I can get my job done, plus or minus. Basics alone aren't that helpful, but when something arises that steers from the standard way of doing the stuff promoted by the top abstraction layers, a great deal of the times I will need to dig right into the core in order to be able to solve my issue. Well, plus or minus, I personally call this the Onion Theory. This is related to the 'darkness surrounding you' concept explained above. Awesome.

Re: Ask HN: What habits made you a better programmer?

#88
1- semantics matter. Names should neatly describe what they refer to.

2- avoid mutable variables. Using the same name for two things is just another way to get tripped up.

3- if you're going to ship it, try to stay in the lower (50%) range of your abilities. This is how to get things done lightning fast in my opinion. Work on your skills and improve every day, but to produce something functional and enduring you should be technically conservative and produce something you thoroughly, thoroughly understand.

4- Your abstractions should be accurate, precise, and cognitively manageable.

5* Non-programming organization skills matter. Identify stakeholders, gather requirements, set priorities, PRODUCE, get feedback... repeat.

Re: Ask HN: What habits made you a better programmer?

#89
post #81

Earlier quoted context omitted.

Actually by taking a nap you are doing something really cool. Let me explain: You are actually inviting your right hemisphere(the creative side of your brain) to come out and play. The right hemisphere cannot be forced into thinking that much so by taking a nap you are actually letting the unconscious work for you. As a really interesting side note, Thomas Edison used to take a nap whenever faced a difficult problem.…

I've heard this left-brain right-brain stuff before and I'd like to know where it comes from. Do you have any sources you can link to?

It's related to early brain research which discovered some left right specialization. Medically it's been mostly debunked, but for some reason "Pseudo Science" people really latched on to the term.

PS: By “debunked” it was discovered that the brain has more plasticity in how and where specific tasks where preformed that initially assumed. Also the high level understanding of what doing “Math” or “Poetry” has little connection to how the brain actually does this stuff. EX: Some people can count time accurately why reading other people can’t. The most probable explanation as you grow up the brain chooses how to approach high level problems in a fairly arbitrary fashion.

Re: Ask HN: What habits made you a better programmer?

#90
post #74
post #45

Earlier quoted context omitted.

There's no clean path with regard to this. Either you plan too much ahead and you end up tweaking your design forever, eventually building high-level cruft code that still won't get anything done because you don't dig deep to the ground to find the real culprits of your solution. Alternatively, you plan nothing at all and end up rewriting your program several times because you just won't see the big picture as you're…

Since I'm still in the early stages of learning to program (past the "durr what are for loops" stage, but still not good at a language), I've found that it's nearly impossible to really plan anything out. I can plan out what I'll put stuff in and the names of the classes and methods that'll work with data, but I'm clueless until I start trying to implement the idea. I suspect that once I've done enough things, it'll…

Quoting myself: You can only plan what you know of, and it's not much at first but it's something. :-)
Post reply on HN