Annoyance #215
Engineers who use the phrase “Best Practices” to rationalize doing, or not doing things.
This strikes me as a lazy way to state an opinion, and make it sound more authoritative. If something works, or doesn’t work, explain precisely why. Don’t just invoke the nebulous specter of “Best Practices”.
May 23rd, 2008 at 2:03 am
[…] KrazyDad » Blog Archive » Annoyance #215 If something works, or doesn’t work, explain precisely why. Don’t just invoke the nebulous specter of “Best Practicesâ€. (tags: software development programming) […]
May 24th, 2008 at 6:15 pm
I think you need to have the term ‘best practices’ so that the programmers who dont understand the ‘why’s of creating software can set themselves on the right path. These are the people who only understand the ‘hows’ of writing code, as a result they need some set of rules that they can blindly follow, the rules are drawn from the experiences of very good programmers.
Often people who sort of create those rules / recommendations, rarely call them ‘best practices’, for example I have never heard any ‘flash best practices’ from you :)
but if you could have a list of these rule, I would happily quote them as ‘best practices’
May 25th, 2008 at 2:00 am
Amit,
You make a good point. When I wrote that, I was responding to an email in which someone justified a particular course of action that way. It was not at all clear to me why the action was considered a “best practice,” and I would have much preferred a sentence or two of explanation.
Almost everything we do in engineering has a context, and for almost every rule-of-thumb, exceptions can and must be made. If we do not know those underlying reasons — if we are unaware of the context, and only blindly adhere to the “best practices” given to us by others, we will not know, nor care, when those exceptions are necessary.
Amusingly, some of the recommendations I have made to my flash students would almost certainly be considered a violation of best practices by others. For example, I generally recommend that new programmers of Actionscript 2 use the deprecated random(n) routine, which returns an integer from 0 to n-1, rather than the officially approved Math.random() routine, which returns a floating point value from 0 to .99999999. This is because even though the random() routine is deprecated (and was deprecated years ago), it still works, and it is easier for first time scripters to use correctly. I have seen a great number of people misuse Math.random() when trying to get integer results – for example, people who want an integer from 0 to 5 will
commonly use
Math.round( Math.random() * 5 );
…which is almost always a “bad practice”, unless you actually wish the probability of getting a 0 or a 5 to be half that of getting a 1,2,3, or 4.
It’s all a matter of context. If you wish to not use deprecated routines, than using Math.random() instead of random(n) is a “best practice”, but if you wish
to give a neophyte a better chance of writing code that works as expected, than
maybe it’s not…