Live data from Hacker News

Ask HN: What habits make a programmer great?

news.ycombinator.com

121–130 of 191 posts

Re: Ask HN: What habits make a programmer great?

#121
post #97

Earlier quoted context omitted.

> Take a look at filesizes. The biggest files usually contain the meat of the program, or at least a dispatcher that points to the meat of the program. main.cc is usually tiny and useless for finding your way around. This is my #1 pet peeve with GitHub. When I first look at an unfamiliar repo, I want to get a sense of what the code is about and what it looks like. The way I do that with a local project is by looking…

Yes, absolutely! I really want a whole-repo tree view of files along with their sizes and file types.

https://chrome.google.com/webstore/detail/octotree/bkhaagjah...

Check out Octotree if you're using Chrome. No file sizes still, but I've found that when you just want to quickly explore some potential new source this beats having to clone the repo first.

Re: Ask HN: What habits make a programmer great?

#122
post #71

Earlier quoted context omitted.

Great advice. One nit to pick: > Don't ignore constant factors. Sometimes an algorithm with asymptotically worse performance will perform better in practice because it has much better cache locality. Forget the cache, sometimes they're just plain faster (edit in response to comment: I mean faster for your use case ). I've e.g. found that convolutions can be much faster with the naive algorithm than with an FFT in a p…

Good correction, but a small second nit. > sometimes they're just plain faster Not faster for sufficiently large N (by definition). But your general point is correct. I've best seen this expressed in Rob Pike's 5 Rules of Programming [0], Rule 3: Rule 3. Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big constants. Until you know that n is frequently going to be big, don't ge…

>Not faster for sufficiently large N (by definition).

True, but supposedly researchers keep publishing algorithms with lower complexity that will be faster only if N is, like 10^30 or so.

Or so Sedgwick keeps telling us.

Re: Ask HN: What habits make a programmer great?

#124

Focus on the problem and not the tools ceremony around it. Don't follow the herd and the hype. When given a problem, keep drilling the problem until it is absolutely clear to you and then only work on solution.

This is going to depend on what one specifically means by "great", but I would caution against adopting this perspective too thoroughly or sincerely.

There is a lot to be gained by going along with the dominant groupthink on a topic, and there is a lot of risk involved in declining to do so. This is especially true as the groupthought picks up steam and gains powerful backers, who will be offended that little-old-you would dare to contradict someone of their high status.

The likelihood that your successes over the conventional/trendy method will be undeniably obvious is very low, especially when you consider that as larger interests and personalities invest in the groupthought, their PR machines will be working to discredit/counteract those who stand to imperil their investment. You will probably not get the punchy ending that you'd need to justify the burn you initiated by going your own way.

You could try to argue that the rest of the team is just trying to follow the zeitgeist instead of thinking about how to generate objective value, but this will hurt much more than just smiling and using the "Tech Flavor of the Week" on the project.

Team cohesion is more important for large-scale productivity than technical implementation details. It's easier to work around a buggy framework than it is to get people to cooperate and release their grudges.

If you want to be a "great programmer" in the sense that you have maximal self-satisfaction, then yeah, you should use whatever you think is best.

If you want to be a "great programmer" in the sense that you're a hot commodity on the market with a strong network full of people who want to give you money, you must recognize that your field of operation is not really computer code, but the delicate egos of the humans around you.

---

Along a less social track: the bigger the technology gets, the more likely that its kinks will get worked out and that it or something based on it will become a driving force in something that is objectively useful/valuable down the road, at which time having the investment in the platform makes it easier to adopt the better tech from both a technical (increased familiarity with tech-specific syntax and concepts) and personal perspective (don't have years of resistance that you've brainwashed into yourself, + accompanying reputation).

JavaScript is a good example of a technology that has been difficult to justify at a technical level in any case where it wasn't mandatory up until very recently. However, its widespread faddiness is now starting to cause actually useful new things to be JavaScript-first or JavaScript-based, even if they're doing that just so they can ride the hype wave themselves.

Re: Ask HN: What habits make a programmer great?

#125
1. Embrace the grind. Motivation comes and goes, but the grind remains. This doesn't mean working all day every day, but rather setting aside specific blocks of time and doing the same thing every single day. Workouts should happen at the same time every day. Work should happen at the same time every day. Each of these things should be daily habits and doing them at the same time every day helps them become habits.

2. Avoid flow[0]. It's tempting, seducing and addicting, but you don't learn anything when you're in a state of flow. Anything sufficiently hard as to improve your skills should leave you feeling a little frustrated. Get used to that feeling.

3. Drop TV, Porn, news, music and video games. These things all give you rewards without having to do any work. In doing so, they steal your motivation and energy.

4. Stop eating sugar. If you want to get things done, strive for a steady blood sugar level. It's hard to work when your blood sugar drops and you fall asleep at your desk.

5. Sleep during the hours of 10pm and 2am[1]. That's when your body makes most of the hormones you need every day.

6. Do the opposite of this video: 7 ways to maximize misery by CGP Grey: https://www.youtube.com/watch?v=LO1mTELoj6o

[0]: http://calnewport.com/blog/2011/12/23/flow-is-the-opiate-of-...

[1]: http://www.anitarossiter.com.au/blog/early-nights-are-in-ord...

Re: Ask HN: What habits make a programmer great?

#126
They learn their tools really well. I can't tell you how many good professional programmers I know that are utterly handicapped in their speed because they navigate the code base in an inefficient way, can't rename things quickly, can't catch something with the debugger, etc. Once a lot of those inefficiencys are gone it makes more mental room to think about the problem without distractions.

Re: Ask HN: What habits make a programmer great?

#127
post #125

1. Embrace the grind. Motivation comes and goes, but the grind remains. This doesn't mean working all day every day, but rather setting aside specific blocks of time and doing the same thing every single day. Workouts should happen at the same time every day. Work should happen at the same time every day. Each of these things should be daily habits and doing them at the same time every day helps them become habits. 2…

Can you elaborate on point 3 ( Music part).

Re: Ask HN: What habits make a programmer great?

#128
Empathetic coding rather than "show off" coding. Basically rather than trying to impress the next person with the least amount of lines you can write with the most ridiculous variable names, use consistent formatting spacing naming logging and comments to explain your decision process.

Always remember code does not capture the decision process it only captures the outcome.

Re: Ask HN: What habits make a programmer great?

#129
3 pieces of advice that have helped me.

1. RTFM, I was told this for about every question I had as a beginner, and had to prove that I at least attempted a solution. This was before Q&A sites like we have now. 2. Learn to create head space, be that meditation, yoga, going for a walk, whatever it is for you. Find it and use it to your advantage. 3. Expand your consciousness - Understand you are not the center of the universe, how every you choose to get there.

Post reply on HN