Search This Blog

Sunday, October 24, 2010

Html is why the mess in programming syntax

You want to Shout NON SEQUI…  Just a minute…

When I was a student studying databases, the book talked of how data stored in flat files is not so good as a database.  Give this wisdom to today's kids and you'll get a funny look:  Whoever stored data in a file rather than a spreadsheet?

Likewise, years ago when we had to write text we... well... wrote text.  And then if necessary processed it through some baroque tool(chain) like latex, troff etc.  Once again the modern user of computers seeing this is dismayed: Why all this when we can just use Word?

And yet programmers continue to be decades behind all other users of computers.  When all others have moved on, we continue to
Use flat text for our programs
A program is a very interconnected entity: when we see a function-call we may want to see the function:
  • if its my own function go to its definition
  • if its a system function go to its manpage
Likewise when we see a declaration of a variable to have a type T, the reader could justifiably want to see the definition of T, which could be in a variety of places and in a variety of forms.

All this clearly calls for hypertext and hypertext means html, and html is such a mess from the structural/semantic pov that language designers justifiably shy away from this and stay with the good, 40-year-old option: text files.

Is this idea new?

Hardly.  For years C programmers have used tags and more sophisticated tools like gnu-global and doxygen. Then there is eclipse that is more integrated and .Net which is even better with its attributes. The problem with all these is that they are structuring band-aids on unstructured flat text.

Also, closer to what I am talking about is the prior art in Lisp and curl.

Then there is the whole mess of tabs, indents etc.  Here's a first cut at a more modern solution than the ancient tabs-vs-spaces – aka typewriter – argument.

IOW baby-steps towards

Hypertext

But as soon as we hear 'hypertext' we think 'html' and programmers naturally want to run away.

Ok now you are allowed to look at the title of this post and shout:


NON SEQUITUR

2 comments:

  1. Your wit sir is legendary! :D
    On a more serious note,learnt a lot from your post (y)

    ReplyDelete
  2. No harm in learning from prior art right?

    ReplyDelete