News for hackers. Stuff that matters.
Re:World's most maintainable programming language by BrandonM on Wednesday May 16, 2007 @02:04PM (#22583)
Along with nostrademons, I disagree strongly with that article. In my opinion, the thing that affects maintainability the most is the length of the resulting programs. What's easier to maintain, 20 lines of paren-filled code or 200 lines of BASIC garbage?

I especially disagree with the last criterion: enforcement of good programming practices. The definition of good programming practice varies greatly with the intended use, and is something that is best defined on a problem-by-problem basis. Every language I've encountered that attempted to enforce "good programming practice" has required me to write workarounds anytime I wanted to do something interesting.

One good example is writing a few Java classes that inherit from a parent in different ways, and then making a few method calls to note which method was called. I wanted to print something akin to:

"Entering class Child constructor.

Entering class Parent constructor.

Exiting class Parent constructor.

Exiting class Child constructor."

The easiest way to do this is to have something like

public Child () {

System.out.println("Entering class Child constructor.");

super();

System.out.println("Exiting class Child constructor.");

}

Unfortunately, the creators of Java decided that good practice maintains that the call to the parent constructor must occur before any other code. Because of this, I had to create silly workarounds with parameter overloading to call the parent method, something that was not at all extensible or scalable.

If you want maintainable programs, use a powerful language, hire good programmers, and agree on some common conventions. If something doesn't fit within the conventions, discuss it and clearly comment it in the code. How hard can that be?

Only so much can be automated. At some point, programmers have to take responsibility for what their programs look like, and no "maintainable language" will ever be able to solve this problem.

There are no comments on this comment yet.