|
Computers -
Miscellaneous
|
|
Written by Wojciech Kocjan
|
Some of you might know this, some of you might not, but Philip Greenspun has written his Tenth Rule of Programming, which says:
Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
I recently came across a rephrasing of it.
The rephrasing said:
Any sufficiently complicated C or Java program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Tcl.
I kind of agree with that - and not only when it talks about Tcl or Lisp, but about a wider problem.
Over the years I've worked with a lot of projects. Some were larger, some were smaller. But one thing remained constantly the same - each did a lot of work that included reinventing the wheel. In many cases what happened was that when somebody needed a way for users/developers/admins to pass simple flow controls, conditions or logic, people created something from scratch. As projects grew, these home-made systems were abused to a level where they actually became languages of their own.
The short term issue with this is that you spend huge amount of money, time and energy on creating yet another specialized programming language. In many cases, parser for the language is done as regular expressions, hacked over and over to expand syntax as needed. In some cases, it was even done on top of XML - like Symkin Scripting language.
The long term issue with that is that you end up with a lot of people maintaining something that should have never been created. Time spent on this should have been spent on anything other, more producting, more reasonable. Let's face it - if you'd picked up Tcl, Python, Perl, Lua or anything else, you'd just have a stable solution handy.
So, if you are out there wondering whether to use an existing scripting (I prefer the name dynamic) language vs doing a small ad-hoc system, go for a programming language. Any that will fit your criteria - if you need small, go for Lua or Jim. If you need something bigger, go for Tcl or Python. Or if you know any language and know you can embed it in your project, go for that. But never, ever go for creating your own language even if you need very little functionality.
What usually happens over time is that you'll get a gigantic monster to maintain, that does not scale, is not optimized, no advanced features like bytecode and will be your bottleneck after several years.
To finish, some interesting notes you might not know about, but I like:
The rule is called Tenth Rule of Programming, even though this is the first rule he created. The reason, as he said it: Sorry, Han-Wen, but there aren't 9 preceding laws. I was just trying to give the rule a memorable name.
Philip Greenspun created the company ArsDigita, which created opensource framework for building web sites with Tcl and AOLserver, and made $20 million out of it; this is one of the reason he's semi-retired now
Philip Greenspun created photo.net, one of the first site to share photos with community, using Tcl and AOLserver, which is being used for hosting the site all the time
|