Live data from Hacker News

Ask HN: What habits make a programmer great?

news.ycombinator.com

71–80 of 191 posts

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

#71

Meta-habit: learn to adopt different habits for different situations. With that in mind, some techniques I've found useful for various situations: "Researchey" green-field development for data-science-like problems: 1. If it can be done manually first, do it manually. You'll gain an intuition for how you might approach it. 2. Collect examples. Start with a spreadsheet of data that highlights the data you have availab…

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 get fancy.

[0] http://users.ece.utexas.edu/~adnan/pike.html

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

#72

Meta-habit: learn to adopt different habits for different situations. With that in mind, some techniques I've found useful for various situations: "Researchey" green-field development for data-science-like problems: 1. If it can be done manually first, do it manually. You'll gain an intuition for how you might approach it. 2. Collect examples. Start with a spreadsheet of data that highlights the data you have availab…

> 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 at the largest files first. But GitHub loves their clean uncluttered interface so much, they won't show me the file sizes!

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

#73

Meta-habit: learn to adopt different habits for different situations. With that in mind, some techniques I've found useful for various situations: "Researchey" green-field development for data-science-like problems: 1. If it can be done manually first, do it manually. You'll gain an intuition for how you might approach it. 2. Collect examples. Start with a spreadsheet of data that highlights the data you have availab…

> 2. Collect examples. Start with a spreadsheet of data that highlights the data you have available.

This is true not just for data science but when trying to solve any numerical problem. Using a spreadsheet (or a R / Python notebook) to implement the algorithm and getting some results has helped me in the past to really understand the problem and avoid dead ends.

For example, when building a FX pricing system, I was able to use a spreadsheet to describe how the pricing algorithm would work and explain it to the traders (the end users). We could tweak the calculations and make sure things were clear to all before implementing and deploying the algorithm.

Great advice!

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

#74

The "developer on fire" podcast closes out each episode by asking the guest to provide three tips for delivering more value. Some that occur frequently are: * Take care of yourself. Get enough sleep, exercise and healthy food. Have hobbies. * Constantly learn new stuff * Practice communication skills. Building stuff fast and well doesn't help if you're building the wrong thing, and you need communication skills to pr…

> * Practice empathy Any tips on how to do this? I don't often feel things for myself and it's even rarer to experience empathy at a level I can detect. I meditate to try to better understand and learn to detect my feelings, but haven't made much progress yet (I use Headspace).

Having pets and being a good pet owner really helps.

They can't speak. You have to empathize with them to have any relationship with them. In social situations you'll end up reading body language and worrying about other's feelings without even thinking about it due to pet practice.

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

#75

Meta-habit: learn to adopt different habits for different situations. With that in mind, some techniques I've found useful for various situations: "Researchey" green-field development for data-science-like problems: 1. If it can be done manually first, do it manually. You'll gain an intuition for how you might approach it. 2. Collect examples. Start with a spreadsheet of data that highlights the data you have availab…

To expand on your #2:

I work with a lot of traders. One antipattern I noticed is that when there's a problem with the data, they'll do all sorts of permutations and aggregations and then scratch their chins and ponder about it for hours.

Go to the fucking source and find an example of the problem! Read it line by line, usually it will be obvious what happened.

Corollary: Don't assume your data is correct, most outliers ina large data set are problems with the data itself. Build a few columns that serve as sanity checks. One good example is a column that shows the distance between this sequence number and the last, anything >1 is a dropped message.

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

#76
One habit that I think is important, and often overlooked, is to be able to break out of a mindset and questioning yourself with:

"Am I solving the problem at the correct level, using the appropriate method/technique/tool? Don't forget the big picture"

It's easy to just keep coding and add to existing code, architecture and methods. But sometimes the frog is starting to boil. Better then to re-evaluate whether to do some major refactoring, or add some layer of abstraction to keep it maintainable.

Sometimes you need to recognize that you're merely treating symptoms rather than a underlying problem. Sometimes you need to recognize that there are some library/tool/algorithm etc that can eliminate the need to solve a problem yourself.

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

#77

Meta-habit: learn to adopt different habits for different situations. With that in mind, some techniques I've found useful for various situations: "Researchey" green-field development for data-science-like problems: 1. If it can be done manually first, do it manually. You'll gain an intuition for how you might approach it. 2. Collect examples. Start with a spreadsheet of data that highlights the data you have availab…

Great comment! I have one point to add to '"Researchey" green-field development for data-science-like problems':

6. Use assertions for defining your expectations at each stage of the algorithm - they will make the debugging much more easier

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

#78
Assume there's always a better, faster solution to the problem than the one you've come up with. Finding it will require deeply understanding the problem, and sometimes redefining the problem.

Put another way, working long hours is a bad habit because you end up solving problems the brute force way instead of figuring out how to come up with better solutions.

I think of this aiming towards becoming a 0.1× programmer: achieving same or better results with 1/10th the lines of code and effort. More here: https://codewithoutrules.com/2016/08/25/the-01x-programmer/

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

#79
Another quote by Kent Beck that I value it highly and practised is "Make it work, make it right, make it fast".

-

I'm not a great programmer myself but some of the habits I've developed and found effective are:

1. to start exercising.

I started running and going to the gym early last year and managed to make it part of my weekly routines now. I feel like I can focus on doing programming tasks much longer now. Oh, and it also helps me in term of accomplishing my short-term goals.

2. to always carry a book

Always be learning. Be it a medium articles, fiction or non-fictions, etc, it doesn't matter. As long as I am constantly learning new stuff, it's fine. It also help keep my ego in check since there are so much unknown I've yet to learn.

3. to stop whenever I'm feeling tired

I take a break from codes every now and then. Sometimes a few days or weeks. This allows me to avoid burnout which I've experienced once in the past.

Post reply on HN