Who is an Expert? – On Rules and Exceptions

It is relatively easy to find very young people who are brilliant programmers, who seem to know every detail about a particular language, platform or technology. Some of them will be able to implement a nice Android app in a few days, others can write cool Facebook games in a week.

These bright young programmers are frequently very quick learners as well. Give them a new programming language and they will grasp its syntax in a couple of hours. Present them a new API and they will very soon understand all the differences among similar methods and the roles of each parameter.

Now the question is: Do their knowledge and ability to learn transform them into expert software developers?

Whenever I meet these young programmers, I remember this quote:

“The young man knows the rules, but the old man knows the exceptions.” – Oliver Wendell Holmes

So my answer to the previous question is “No”. Knowing the rules of a programming language or platform can make you very effective when working in a particular environment. But to really be an expert you must know the exceptions. You must know when to violate the rules.

1st Example: Composition versus Inheritance

I once worked with a good Java programmer that followed the rule “favor composition over inheritance”. The problem is he was fanatic about it: In all situations he used only composition. In his programs you could not find a single class extending another class. If he wanted to reuse a class, he would just encapsulate it in a new class and forward most method calls. A rule with no exceptions allowed…

2nd Example: Const-Correctness

I once participated in the development of a very large C++ system. I noticed that almost none was using const methods, and as a consequence they could not pass const parameters, even if an object was not supposed to be changed by a function.  I was surprised; it seemed that most people were not aware of the importance of const-correctness.

But then I discovered another reason for this mystery: Most programmers didn’t know about the possibility of declaring a data member as mutable. Then, many classes that used synchronization mechanisms had not const methods, even when the state of the object was not being changed. Even the accessor methods could not be declared as const, because they were changing some lock.

The rule says that const methods should not change the values of data members. But the real intention is that they should not change the object state. Hence the exception to the rule is that Semaphores and Mutexes can be changed by any method, because they are not part of the object state. They should be declared as mutable.

Conclusion: It is relatively easy to learn the rules, but only experience can teach you the exceptions. If you know the rules and the exceptions, then you are an expert.

I will be happy to hear in your comments more examples of rules and exceptions. Please share your experience. Thanks!

About Hayim Makabee

Veteran software developer, enthusiastic programmer, author of a book on Object-Oriented Programming, co-founder and CEO at KashKlik, an innovative Influencer Marketing platform.
This entry was posted in Efficacy, OOD, OOP and tagged , , . Bookmark the permalink.

4 Responses to Who is an Expert? – On Rules and Exceptions

  1. Putcha V. Narasimham says:

    I do not have the first hand knowledge of actual programming but I think the points made are useful.

    If a method to be followed by a professional have complicated rules and exceptions, the professional work becomes complicated and specialized. The methods and tools are for average people to do a good job with min attention and effort or expertice. If not one has to view that the methods and tools have not evolved to be robust and useful for wider use.

    Perhaps the designers of software tools may have to explore how to detect possible errors and guide / prompt the users to avoid typical errors. I use MS Office and e-mail extensively. I find they are evolving to demand less from me and yet speed up my work and quality of the work.

    I would like to see a similar improvement in the software modeling & design tools to do more work with less errors—-without becoming an expert to know all the intricacies, traps etc of the tool I have to use.


  2. Pingback: Repost – Who is an Expert? | Can I change this later???

  3. Pingback: The Seven Rules of Effective Communication | Effective Software Design

  4. Pingback: Do SOLID design principles make code slow? | Effective Software Design

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 )

Twitter picture

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

Facebook photo

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

Connecting to %s