Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This reply is akin to "just think about it and do it perfectly dummy" which might sound "obvious" and "smart" but is really just unhelpful commentary. The ideas provided in this blog are actually a good heuristic for improving code in general, even if they don't apply in all cases. Simple and practical rules of thumb can go a long way for those without enough experience yet to have internalized these kinds of rules.


I don't agree it is unhelpful commentary. I think it makes an important point that just following some rules you found won't be enough because the right answer isn't a result of something arbitrary/universal but is a side effect of a better understanding of the responsibility of each piece of code you're writing.


I think you’ll have better code on average if you always apply these rules than if you don’t.

It’s not always helpful to give people the option to do it as they think is best.


> than if you don’t

If by “don’t” you mean “do the opposite” then I agree. The third option is “don’t follow the rule blindly but think about the situation”, and for that case it depends entirely on the person and how well they think.


I do think it is shortsighted, and equally helpful and harmful. Helpful in that it reminds the reader this is only one of many considerations that should be taken into account. Harmful because it borders on implying that this shouldn't even be a consideration taken into account because it is irrelevant.


Trying to help too much, and give shortcuts to people who cannot otherwise evaluate when these shouldn't be applied has ill effects.

On the same note, I find the reasonning behind the advice way more interesting than the advice itself. It gives a good framing of the different issues to consider when writing conditional and iterative code.

Basically it should help newcomers to identify the issues they're facing and build their own personal heuristics.


A lot of replies in this tree read to me as "don't concisely express a general heuristic principle, because someone might read it and apply it without nuance".

This way of thinking is infantilizing. It is also self-defeating, because it is itself a failure to apply with nuance a general heuristic principle (don't oversimplify). It's doing what it tells you not to do.

Heuristics are only heuristics, but you have to articulate what they are before you can append "and this is only a heuristic, don't apply it blindly and universally".

Appending "everything depends on context" is the trivial part. The heuristics are the substantial contribution.


I see your side, but take it the other way: the basic message is really "you'll have to think for yourself anyway, heuristics from random strangers won't help", which I don't see as infantilizing.

I see post mortems and issue discussions on public projects as a better resource and contribution than sharing personal heuristics.


Better phrasing might be, this is a really good point, and while you can't rely on it alone, the more of these you learn, the better of a programmer you'll be.


Our job is to think about problems and solve them, I'm in completely agreement with GP


If you were going to generalize your hard-won knowledge and pass it on to a junior, what would you say?


"Draw the rest of the fucking owl"[1]

1: https://knowyourmeme.com/memes/how-to-draw-an-owl


There isn't an easy shortcut. Experts exist for reasons. Just like Doctors and other specialists, find a good expert you trust and evaluate their evaluation of the topic.


Doctors rely on an enormous number of heuristics and shortcuts exactly like this.

My wife teaches doctors, and so much of what she does is giving them rules of thumb much like this one.

edit: I want to note that I'm pretty ambivalent on the actual advice of the article, just commenting that doctors in my experience have a truly astounding collection of rules of thumb


An expert in a field tends to be an expert of the rules of thumb, the references to consult when the rule of thumb doesn't deliver the desired results, and the nuances and exceptions that are the art part of 'science and useful arts' for their field.


"Keep at it, it can be frustrating at times but if you keep studying and practicing how to become a better developer, you will become one"

There are no shortcuts in life. You need to work at it. Cognizant practice got me there, and I think it will get you there, too.

I get people asking me how to become a programmer all the time -- and I always say the same thing: You can't talk about it, you need to do it. You need to write programs, writing software will make you a better programmer.

Have opinions on how to write good software, be open about these opinions, but also be aware that they could be bad opinions, misinformed, or lacking greater context.


In reality these ‘rules of thumb’ become dogma and people forget why the rules of thumb existed in the first place, or make up other bullshit rules to justify it.

This industry is full of dogma and self-appointed experts and it’s utterly tedious.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: