Thursday, June 01, 2006

Use of non-basic techniques

I have questioned myself about this several times, and more often than I'd like, the conclusion I come to is not the one I would wish.

  • Is it viable, or even responsible to use "advanced" programming techniques in the workplace ?

The problem here is related to how people use the languages they have at their disposal.
There is a recurring joke about how C++ was named, basically pointing that the name of the language itself is a post-increment operator, and that is the reason so many people use C++ just as they used C (or like a hybrid I jokingly call C+/- ).
C++ is widely regarded as a language that is difficult to master. As such, is it a good idea to use, for example, template metaprogramming, when there is a (sadly strong) possibility that someone that isn't very confortable with regular templates will have to look at your code ?
One could argue that if the code is well designed (and eventualy bug-free), the implementation details should be just details and the other users wouldn't need to know them. But considering that someoone else will probably have to maintain your software, is it really wise to use techniques that might take some time for them to understant ?

From a purist point of view, I believe it is a good idea to do so, because it will probably force your colleagues learn something new, and thus, become better professionals.
On the other hand though, the saying "time is money" springs to mind.
Sometimes, this time might not even be available, and we all know what tight deadlines can do to code quality ...

What is you opinion about this issue ?

1 Comments:

At May 28, 2008 at 12:24 AM, Anonymous Anonymous said...

The fact is that you are a professional. And a professional doesn't think about helping others to learn through his code when coding for a customer. A professional will write the most maintainable code he can. Yes, "maintainable" and not faster/prettier/smaller. And that means, in the case of C++, avoiding certain features and constructs that makes it more difficult to read (maintain) since less people is familiar with them. Not everybody has your good skills ;)

But take my view with a grain of salt, because I hate a few C++ features; they are too complex. By using more advanced features you can be less verbose of course, but much less explicit as well, and that *really* hurts when they drop a big project on your lap to fix a bug ASAP, even if you are familiar with the most advanced C++ features.

As systems complexity grows, you want simpler/clearer things, not more complex/obscure ones.

 

Post a Comment

<< Home