new years resolutions

Peter Hansen peter at
Sat Jan 4 04:05:54 CET 2003

andy wrote:
> I can't remember ever having seen HTML described as a /programming/ language.

I'm certainly not the first, but the viewpoint does seem slightly rarer
than the contrary one.  I have a theory about that...

> Doesn't HTML stand for HyperText *Markup* Language?
>                 *Markup* as in what TeX and its cronies do?
>                 Language as in a formal /syntax/ - rules for writing in a manner a computer
>                         can 'understand'?
> HTML is obviously a formal language, but would you classify, Tex, for
> instance, as on a par with it?  Tex is not (I believe) HyperText based/aware,
> but it does a similar job when it comes to text presentation...

Hmm.... as far as I recall, TeX is a pretty general purpose language in 
many ways.  I'm pretty sure it's a "real" programming language as you
would define it: allowing the implementation of logic of various kinds.
Whether that's the case or not, I don't see the two as differing fundamentally,
other than in scope.

> I think that it may be worth evaluating whether or not one could implement an
> /algorithm/ in pure HTML:
>         * An algorithm is a method for solving a particular problem

You'd better come up with a much narrower definition if you want to 
exclude things like HTML.  Check for example.

> I think that generally speaking, programmers (the C, VB, Python etc. kind)
> consider the *logic* part of their art to be the 'programming' bit.  I doubt
> if many would consider the production of a bunch of print statements to be
> 'programming'...

And yet it surely is, in the right context.

Here's my "theory": those who cannot imagine considering HTML as a programming
language are perhaps more in the realm of "computer science" while those who can
more likely have an "engineering" focus.  Or to put it another way: if you
still live in the ivory tower, you might not yet have a broad enough
experience to see the point.

I've written code in assembly, as have many here.  It's just a sequence of
bytes which, when fed through a very particular and usually rather sophisticated
collection of logic gates (a CPU) causes it to act in a certain way.  Sort 
of like HTML elements being fed through a browser, except that the browser
is not quite so sophisticated.  The fact that the CPU has features that
let the code execute loops, or conditional logic, and that the browser
(generally) does not, is an incidental feature, because the CPU was 
designed to be more general-purpose.  If the browser had need a loop,
then HTML would have it.  Some variants do.

I've written code in ladder logic (as have some here).  That's a "language" 
which models how electrical engineers used to build control systems, using 
a collection of of relays, sensors, timers, and other mechanisms physically 
arranged in a "ladder" configuration.  Without the right program running in 
a special-purpose CPU to interpret the instructions in a certain way, 
nothing much will happen.  As far as that CPU and its embedded program
are concerned, however, the "ladder logic" code is just data, neither
more nor less sophisticated in most ways than HTML.  No loops, either.
It's merely a side-effect of the way the program operates that a loop
happens at all.  Heck, HTML can request a refresh, which is pretty 
close to the same thing.

I've written programs which were designed to operate on complicated data
structures, in which I could specify different operations that would be
executed at various times and in response to various conditions.  The
common term for this would be "data-driven programming".  Once the program
that processes the data is written, most of the work lies in specifying
the sequence of data required to make the program do what you want.
In some cases, the need for logic was missing, so the engine did not
provide any such features.  A slight change and it could.  That shouldn't
change whether the data was a "programming language" or not.

I really have a hard time seeing how any of these cases is different from
the case of HTML being fed through a browser.  The browser is just another
special-purpose "engine" for executing the "code" (like bytecode, or 
machine code, or ladder logic operands, or my data structures above) 
which specifies a series of operations.

Just because the work is specialized, narrow in focus, and not general-
purpose is no reason not to call it "programming".  You're still 
figuring out how to make the computer do what you want, and you're
still using similar mental processes to do the work.  Might not feel
so sophisticated to some, and sure it's fun to look down on those who
are just starting into computers and know only HTML "programming", but
other than resorting to distinctions such as "Turing Complete" to 
exclude certain special-purpose areas, there's not much one can do
to deny it.

> Wheras the general public often consider any given task done with a computer
> to be programming... I have often heard secretaries, kids, passersby talking
> of how they had been 'programming' the computer to "write cd's" or "play
> quake", where they meant they'd *installed it*...

You mean you don't see how someone installing a shortcut in their "Startup"
folder in Windows 98 is "programming" their computer to do something
desirable on startup?  Sure it's a pretty borderline case, but why
can't that be called "programming" too?  Do we have to refer to it as
"telling the computer what to do", but say "but it's not programming"?
Where does that get us, other than in a clique?

> The concept of programming is probably more a matter of perspective.

True.  I'm hoping to help a few people break free of the bonds of their
experience to date and consider that many different things are actually
just "programming", and perhaps thereby discover interesting ways to 
transfer the useful patterns they have learned into new areas.


More information about the Python-list mailing list