Hacker News new | past | comments | ask | show | jobs | submit login

HTML and CSS are each a language by which a person expresses instructions for specific transformations of an input string into computer output. If Kernigan and Ritchie were correct to call "Hello World" a program then HTML and CSS would quack in the right way to be programming languages even if it were not possible to make syntax errors or they did not require f5 to see if the latest attempt at debugging worked.

That they are easy and forgiving, ought to make us consider them as worthy models for our next language not as objects of scorn,




There is quite a distinct difference imo.

One certainly could describe html and css as 'declarative' programming languages in that sense, but I think its a pointless definition then because all data fits that same definition - so why not just call it data?

The key thing here is about what is encoded, not what the output is. A C Hello World program encodes a call to printf along with a data string as a piece of executable code in the entry point of some executable format - the fact that printf is a library function is deceptive - because the encoding of that is important too and it describes how to interact with the OS to output text. HTML containing "Hello World" encodes merely the string and gives you no choice of what is done with it - nor can you interact with the OS, the hardware or any of the surrounds without introducing more (e.g. JavaScript).

However, the fact that you edit it directly in a text editor makes it coding. I have no disagreements with that at all... but the fact that HTML and CSS are difficult to use data formats doesn't qualify them to be 'full' programming languages imo.

As for scorn, I have no scorn towards HTML and CSS because of their perception of being code. I do however have plenty due to the design and real world implementations - not because they are 'easy', but in fact they are much harder than they need to be due to a combination of poor design and poor browser implementation. I can qualify that a lot, but its an article of its own I guess... not a comment. :)

Any decent programmer should be able to design a superior alternative to HTML and CSS imo. Its not a difficult task.


To push the analogy further, just for the hell of it, the html:

     <p class="fancyText">Some fancy text</p>
does in fact transform the data without javascript [or rather it might transform it in combination with appropriate CSS].

Pushing further: How is #include in C much different from <script></script> in JavaScript?

I mean hello_world doesn't do anything interesting without calling `printf` and `printf` for all we know might have been written in assembly. To put it another way, without the various libraries, about the only interesting thing a C program can do is crash your computer.


"HTML [is] a language by which a person expresses instructions for specific transformations of an input string into computer output."

I disagree. HTML describes the semantics of the input, nothing to do with how it is 'transformed'. I see it as a form of punctuation.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: