Wednesday, April 6, 2011

Programming as a Science

This blog has a new home:
http://selectioneffect.info/blog/programming/programming-as-a-science/

Programmers often present programming as an art to newcomers. Donald Knuth’s voluminous tomes are called “The Art of Programming, Vol. n”. Some programmers believe they’re writing a sort of poem, a thing of beauty. 

Others believe that, while it requires intelligence to program well, the great programmers produce works of sublime elegance, works of art.

Science is not an art form, and programming is a science. You may appreciate beauty in an elegant solution to a problem, and you may experience a sense of wonder at the simplicity of a solution to a very complicated problem, but those emotions are a by-product of the final result. It is something that can only be experienced after the fact. To actually bring about the reality of a well-written program requires something more than the free mindset of an artist.

It requires science.

No-one is going to trust a bridge built by hippies, dear reader.

Only an engineer can design and build a structurally sound, defect free, fault-tolerant, effective and secure structure such as a bridge, or a high rise building.

What kind of programmer would you trust?

If you think: a good programmer is one who can see beyond the cold, technical aspects of math, logic, and sound engineering principles, then you’re dead wrong. A good programmer is not one of the “pragmatic programming” breed, in which disastrous short-cuts and penny-wise-but-pount-foolishness are the prime results, but those are all done under the façade of “customer satisfaction”, “quick turnaround” and, most insidious of all, “business realities”.

Utter hogwash!

Nothing is so important that a two hour job to implement a proper, potentially extensible design should be avoided in favor of a rush job of splicing a solution into an existing system, creating internal and external dependencies in otherwise modular code.

All programming must result in extensible code. By following some basic best practice rules, a programmer can promote loose coupling and tight cohesion, thereby ensuring a future of easy and predictable modification to the code that is written today.

Add some automated integration and regression testing to this philosophy, and you will be able to handle most client requirements with ease.

There is an entire branch of science called “computer science”, which is a growing field of engineering studies that uses mathematics, rigorous testing, the scientific method, information theory, physics, even quantum mechanics.

Please, don’t write a poem, or a jarring catchphrase in the middle of a mathematically sound equation.

Use the knowledge and tools available to you, and grow out of the notion that programming is an art.

You can start by learning the UML. For a good overview of UML, see http://umlbase.com/overview-of-uml over at UMLBase. 

No comments:

Post a Comment