5 ms·
> Is Markup Code? I find this interesting - even though scott says he doesn't think its coding in the traditional sense a lot of people do. This is something
by jheriko 13y ago
> Is Markup Code?
I find this interesting - even though scott says he doesn't think its coding in the traditional sense a lot of people do.
This is something that never comes up in my circles (web programmers aren't 'real' programmers) we all believe it is a way to encode data...
However, there is a common confusion here - code as a word is meant for the sense of encoding data. Program code seems to have swallowed this original meaning so a lot of programmers think of programs and instructions as being 'code' probably because its a short 4 letter word
Even though the conceptual requirements to understand HTML and CSS are far below that for program code, they are very much still a subset of it so I don't think its especially harmful to use the word 'code' in this way.
- brudgers 13y agoHTML 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,
- oneeyedpigeon 13y ago"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.
- jheriko 13y agoThere 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.
- brudgers 13y agoTo 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.
- deleted 13y ago[deleted]