Channels ▼

Al Williams

Dr. Dobb's Bloggers

Take My Advice... Please

July 08, 2011

Over the years I've written quite a few books and many more articles, columns, and blogs on the topic of programming. I think there has always been an idea that if something is in print, it is probably right. But I've noticed a recent paradox. Obviously, I can create a website and promote my idea that everyone should learn to whistle modem tones to reduce the barrier to human/machine interfacing. That doesn't make it a good idea, but simply my opinion (and, just to staunch the flow of incoming e-mail, no, that's not really my opinion). My point is that in years past things you read were usually subjected to some review and fact checking before it was published. With the Internet, anyone can publish anything (and they do).

The paradox is this: For some reason, it seems to me that people have begun seeking validation at every turn from some authority figure. I first started noticing this when design patterns became popular. Don't get me wrong, patterns are a useful tool. They help you capture things that work and present them to other people. But real design requires you to evaluate patterns and, if none are suitable, figure out the best answer for your specific problem. So as the quality of published information has probably decreased (taken as a whole), our willingness to assume it is right seems to have increased.

This came to the forefront of my thinking this week when someone waved a 3-year-old article from another magazine at me. It is a fine magazine, and the article — which was talking about how to make better embedded system code — was well written and I agreed with most of what was in it. But there was an admonishment against using "clever" techniques. The author forbids the use of templates, inheritance, goto statements, and the ternary operator (as in x=y>10?1:2). He claimed that only the original programmer will understand such a "clever" solution and then will forget how it works.

I thought this was a stunning example of just what I was talking about. I understand goto isn't a popular choice, but no templates? No inheritance? The ternary operator is not that hard to understand. Even if I were inclined to agree on all of these, I wonder how many people use an article like this as a reason to forbid the use of these in every situation? I've seen it before. Yet, I know that there is almost no rule like this that should be iron clad. Our job as engineers is to find the right solution where "right" is a fuzzy concept based on trading the various things we can change and weighing them against requirements.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video