Even Dijkstra disallowed the Break statement

I work on a project that prohibits using the break keyword. Personally I am puzzled by this. For one I do not think it is used all that often. Secondly, if its a legal keyword in the language why are we changing the rules? Are we better than the language inventors.

Now there are many arguments to why disallowing it is a good thing with the most common being that it has burned programs in the past with nasty bugs that were difficult to track down. Other reasons include making code unreadable and adding complexity. Even Dijkstra was against its usage. http://blog.plover.com/2009/07/31/#Hoare-logic

In my view the argument goes beyond the break statement. I say leave it to the programmers choice to use it or not. Here in America we have 4 gas stations per busy intersection….we love choices. When we make bad ones we learn. Sure you get burned some times but typically those are the best learning experiences.

Completely disallowing something is not good practice. It will hinder the programmers who could use it to optimize loops and create better control paths. Sure it will keep the mediocre programmers from shooting themselves in the foot but then when will they learn to use it properly….never.

I advocate personal responsibility and craftsmanship pride. Choices are a good thing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s