164

Example here:

What languages should I know if I'm interested in building web applications?

Yes, I understand that HTML and CSS are not Turing-complete. Yes, I understand that they are declarative, not imperative languages. But why are people always clubbed over the head with this pedantic (and arguably obvious) fact when they ask a question about these languages?

Robert Harvey
  • 200,592

12 Answers12

308

What is the difference, really?

The real and important difference between a programming language and these other languages is this:

HTML and CSS describe presentation, whereas programming languages describe function

I intend to illustrate why this difference matters, but that pedantry on this issue is sometimes misplaced.

A true story:

I once spent a few months developing a complex performance management system using a "proper" programming language. It automated the process of gathering data from various other systems, performed various manipulations on that data and then presented the results in a simple table.

Once it was live, a senior manager saw a tool written for a similar business, and asked if we could replace what I had written using their alternative. Furthermore, he was upset that I'd spent weeks developing my solution, where this new app had been written in a matter of days.

Further investigation revealed that the manager's preferred option was all presentation with no substance: there were lots of colours and icons and graphs, but there was absolutely no logic behind them. All the data had to be gathered and manipulated manually. Despite the pretty interface, the application was essentially useless.

I'm happy to say that the manager in question was persuaded that my approach was the one that met his real business needs.

The importance of presentation:

There is often an implication that skills in HTML, CSS etc. are somehow inferior to skills in "real" programming languages. This is a serious mistake.

In my story, the senior manager felt that design was very important to him, to the extent that he was initially prepared to overlook function in its favour. Now, if this were an isolated incident, I might suggest that the manager was just being silly. But it wasn't. Time and again, I've met users who are impressed by flashy graphics and whizzy widgets, but unimpressed by raw functionality and my technical achievements. I think that there are several lessons to learn here:

  • People evaluate software on criteria that they understand. They often understand the difference between good-looking and ugly, but rarely appreciate technical nuances.
  • People are fooled by appearances. This may not be a good thing, but it is a reality that we must live with.
  • Appearances influence the way people feel about software. The way people feel about software is important to them. Indeed, people sometimes prefer software that makes them feel good over software that is functionally superior. Indeed, they might well be more productive with feel-good tools than with technically superior tools. To this extent, our users are not being fooled. They are actually making a wise and thoughtful choice.
  • As programmers, we often neglect the role of presentation as we focus on function. To some extent, this is right and proper. However, it is important to recognize that there is another dimension to our work that is important to our customers.

So, presentation-oriented languages (HTML, CSS) are important. The value added by those who can use these tools effectively should not be underestimated.

The importance of real programming languages

As the OP pointed out, "real" programming languages are Turing Complete. As a proper sad geek, I find this sublimely fascinating. It means that, for any program written in a T-C language, a functionally equivalent program can be written in any other T-C language. Of course, this isn't to say that all languages are the same. They each have their strengths and weaknesses that make them more or less suitable for certain tasks. However, I/O aside, this means that all programs can be written in all true programming languages.

(Incidentally, the important thing is T-C. The declarative vs imperative is a red-herring here. SQL, for example, is declarative but is also a proper programming language because it is T-C.)

Of course, the same isn't true of a markup language like HTML or CSS. In fact, there are whole classes of problem that these languages simply can't solve. Where I can program anything I want in a true programming language - including layout engines - it just isn't possible to achieve the same things with languages that aren't T-C.

As highlighted in my story, HTML and its ilk are used to produce presentation. Real programming languages are used to produce functionality.

Why are programmers pedantic about it all?

  1. Programmers spend a great deal of time, effort and money developing their skills. People naturally value the things in which they invest ("your heart is where your money is").
  2. Programmers often feel the need to justify the amount of time it takes to produce results compared to the rapid results achieved by UI designers. In order to do this, they need to draw a distinction between what the two groups actually do.
  3. Because employers need to apply the right people to the right jobs. Unless we clarify the (often technical) differences, managers easily make the wrong calls.
  4. Because there is a real and fundamental difference, as outlined above.

Is it always appropriate to be pedantic?

Let's face it, as programmers we're a naturally pedantic lot. It goes with the territory. It doesn't help that many of us have been burned when non-programmers have failed to understand what we do.

Nevertheless (and to be honest, this goes against my natural instincts), I don't think we need to call people out whenever they slip over every little distinction.

The important things here are context and perspective.

I'm told that, from the perspective of a biologist, a tomato is a fruit. But when I buy them in the supermarket, I look for them amongst the vegetables. Why? Because the technical distinction doesn't matter in that particular context. Moreover, the distinction would actually get in the way of their usefulness: if I was daft enough to include tomatoes in a fruit salad, for example.

It is the same with computer languages. There are times when the difference between programming languages and other languages really does matter. Quite often, however, we can all communicate perfectly effectively when just lump them all in together. In the case of the question linked by the OP, it really didn't matter what languages were true programming languages and which were not. Pointing out the distinction didn't advance the discussion in any way. Thankfully, other than adding a little noise (and becoming the stimulus for an interesting discussion!) the pedantry linked by the OP was of little consequence. At its worst, however, pedantry can stir up negative feelings and damages relationships... at least according to my wife.
:-)

How to deal with pedantry amongst programmers

A preacher friend of mine once delivered a sermon entitled:

is this a hill worth dying to be on?

He was referring to generals who make a strategic assessment over which battles are worth fighting: are the gains worth the costs?

  • Is it really worth interrupting the flow of the discussion to make this distinction?
  • Does my pedantry stem from a sense of arrogance or from past hurt?
  • Do my comments value the skills of others as well as my own?

Of course, there are times when distinctions need to be made. My aim is that, when I make a contribution, it will add value to our collective endeavors.

That is, after all, the job of every real programmer.

Kramii
  • 14,199
  • 5
  • 46
  • 64
119

Tell a Civil or Mechanical Engineer that you studied "Software Engineering" and they'll tell you that "Software Engineering" isn't real engineering.

Tell an F-16 pilot that you fly Cessnas for fun and he'll tell you you're not a real pilot.

Tell a doctor that you're a chiropractor and he'll tell you... well, let's not go there :-)

I think it's mostly that people don't like the idea of their profession being infiltrated by pretenders or people who aren't really "worthy".

Now, to be fair, it's quite clear that HTML and CSS are not programming languages. They're no more programming languages that the .docx format is a programming language, and to claim that you're a programmer if all you know is HTML and CSS is certainly inaccurate. But I think some of the vehemence in the reply can be attributed to what I said above.

Also, in the question you linked, the questioner called HTML and CSS a "language", not a "programming language". HTML is a markup language and CSS is a language too (I don't know what "kind" of language you'd call CSS, though?), so I think it was a bit unfair to call him out for calling them "languages"...

Dean Harding
  • 19,911
10

It doesn't really matter to me so much.

But I presume that to those for whom it does, the distinction between HTML, CSS, XML, etc. and Real Programming Languages™ is kind of like the distinction between wood and paint as building materials. You can't build things with paint like you can with wood, and likewise you can't program with HTML like you can with an RPL.

I grant you though, for some conversations, making such a distinction can be irrelevant, and therefore pedantic and annoying.

Eric King
  • 11,008
6

It matters to certain people because neither are rocket science on the surface but there is a great deal of arcana surrounding them due to the fact that they implement differently in typically 5 to dozens of different environments that you actually care about. That sort of unpredictability and attention to craft scares a certain variety of tech professional who is horrified by unquantifiable risks and even more horrified by learning anything more then they absolutely have to after securing a degree.

If somebody asked me what languages I knew and I threw CSS out there and they said "but that's not a REAL language" I would ask them how they would handle vertically centering a div in IE 5, IEs 6-8 and IE9+. Then we could move on to rounded corners, alpha transparency issues, the REAL culprit behind all these ridiculous tables-as-layout arguments that are only just now starting to be become truly irrelevant and dozens more topics for said uber-coder who probably knows one language and claims one or two that he's barely functionally literate in due to classes he was forced to take in college 10 years ago.

They definitely are 'languages.' I would not call them 'programming languages.' I would feel comfortable describing the process of writing in these languages 'coding.'

As far as I'm concerned, however, anybody who has managed to grand master CSS has the chutzpa and work ethic to become an excellent programmer, already has some background in object oriented thinking, and no doubt has learned to think about how what he writes now could impact his work 25 projects into the future.

Erik Reppen
  • 6,281
6

It might not be an "important" distinction, since arguably as much work goes in the html/css part of some websites as in the programming part.

But it is a significant distinction, since anybody that doesn't know what does it mean has no place in a team that does web development.

If a designer believes HTML is programming, let him stay designing with Adobe tools and do print-related designs; but don't believe a thing he might say about web apps.

If a developer thinks he's above designers because 'his' languages are Turing-complete, don't expect him to work well with designer, or that his code can be 'prettified' after it's done.

Javier
  • 9,958
5

You hit it on the head when you said "declarative, not imperative". Markup (be it HTML, CSS, or whatever) describes things. The whole point of programming is to do things.

The skill set required to use markup is completely different than the skill set required to program.

The types of problems solved by writing markup are completely different from the types of problems solved by programming.

HedgeMage
  • 4,303
4

Programming language is a bit of an inexact term because it's a common term that is used by practitioners and the lay person as well. Practitioners have a nuanced meaning of that term where lay person usually doesn't. Normally their definition is if it has funny words/syntax that I don't immediately understand and programmers use it then that must be a programming language. Not completely off the mark, but we can agree it's inexact.

Words like declarative, imperative, and turing complete are more precise terms with very specific meanings. When you ask a question like why is HTML/CSS not a programming language you're asking for a more precise definition of what a programming language really is. We aren't being pedantic, but trying to answer your question. Are they the best terms to use when even if you google them it's hard to understand what they mean? Depends. Did you want the short or long answer. :-)

Programming languages are typically thought of being Turning-complete by programmers, but what does that mean? It means the language can describe behavior or how to do things. We formally call it logic. HTML/CSS can describe there is a button located in the top right corner, or there is a table with 4 columns 5 rows, first two rows are yellow, and the bottom row has green text, and each cell in the table has 5 pixels of blank space around the content.

What HTML/CSS can't do is express the behavior or logic of what happens when you click the button. It can't say when I click that button get the values out of that table and add them up, and write that value to a new row at the bottom of the table. Describing behavior is roughly equivalent to Turning-complete without getting overly pedantic.

More precisely Turing-complete means that you could implement the language in itself. That would mean I could write a javascript program that takes a string of javascript and it could execute it (and not using the eval() function). In fact, I can write a javascript program that could take a program written in any Turing complete language and evaluate it. That's what it means to be Turing complete. All languages that are Turning complete are equivalent in what programs can be expressed. Pretty amazing revelation if you think about it.

2

HTML and CSS are not programming languages. Get Over it.

However: JavaScript is a programming language. The machine is the browser. PHP is a programming language. The machine is a virtual one in the server.

So if you are doing only using HTML and CSS, you are not doing any programming (although you might be doing some engineering).

But if you are using JavaScript, PHP, or another scripting language. You ARE doing programming.

As for REAL programming languages. If you are operating on a machine (real one, or virtual). And are using YOUR OWN algorithms to tell the machine to do things. Then you are using a REAL programming language.

1

The logical "left-brain" or creative "right-brain" pigeonhole/stereotype accurately describes many people's skill sets. In my experience, "is HTML/CSS a programming language" is more about whether people who are good at HTML/CSS can also be good at other programming tasks.

Most of the web designers I worked with in the last 13 years I've been doing web development have been able to create working HTML and CSS, but are not able to handle more demanding programming challenges (anything more than the simplest cut-and-pasted JavaScript). Most of the hot-shot programmers and database designers don't care enough about visual presentation to do a good job with HTML/CSS or presentation in general. Most actually refuse to try.

HTML and CSS require some programming skills: experimentation, problem-solving, careful testing, an understanding of inheritance... But they require at least an equal number of design skills: sensitivity to color, line, spacing, balance - most of the same kinds of visual composition skills that make a good photograph.

Since HTML/CSS is a layout or presentation language, it is at the end of the data flow diagram. No other code sits downstream of it. The larger-level design skills that someone needs in order to design a good API, service, or database schema are not used in HTML and CSS. There is generally no need to modularize anything HTML or CSS related, or if there is, it's not up to the graphic designer to do that. It is rare that any functionality is made with HTML/CSS. Drop-down menus are probably the most common exception, but they can be made by cutting and pasting a recipe off the web rather than by designing code.

It is unusual, but not impossible for a programmer to have some visual design or layout skills or for a designer to have some programming skills. These people are especially valuable on a web team because they help bridge a gap that most of us have. But they are often subject to stereotypes, that being able to do HTML/CSS is impossible for a "real programmer," or vice-versa. But this skill combination is no more impossible than for that same programmer to be a decent sailor, painter, cook, or to have some other skill that they practice in their spare time.

As other people have said, this distinction comes into focus most when hiring. Since people with crossover talents are rare, most job postings have to target one skill set or the other. If a programmer lists HTML/CSS under "Programming Languages" it raises a red flag that they can't accomplish general programming tasks, or that maybe their definition of programming is very narrow. Maybe they can, it just raises a question. If a designer lists HTML/CSS you definitely want to look at their portfolio to see that they have the artistic ability to create the desired visual effect.

HTML/CSS may be repeatedly trashed as not being real programming languages because it is safer and more socially acceptable than trashing people who can't cross the hemisphere divide that they represent. Of course, some people may not have that inhibition. I actually worked with one manager who often said, "He wrote [insert department backbone functionality here]? I thought he just did HTML?"

Great question!

GlenPeterson
  • 14,950
1

Here's my two cents. HTML and CSS are clearly not programming languages. For that reason, when I see HTML or CSS on somebody's resume under "Programming Languages", that simply tells me that this person does not know what he is talking about.

Other than that, no, it does not really matter.

By the way, programmers generally tend to be pedantic. That simply comes with the job.

Dima
  • 11,852
1

I think it comes down to this - HTML & CSS, while complicated enough to require some savvy, are presentation languages, most suited as the format for generated reports. Therefore, people who can only do these were not considered coders. Bearing in mind that some coders have been in computing long enough to remember when the average word-processor took more command syntax to style text than HTML.

I will temper this with the note that gatekeeping by saying who is a "real" programmer and not is less than helpful. Encouraging people learning HTML and CSS into learning javascript and finding a world of more interesting flexibility is a better way. CSS has also become complicated enough that animations, composition and other concepts are present, and it's declarative style is similar to languages like HCL.

What some would call a 'real' language is that which would process data in some way to generate a report. Or something that could be used to write a game. Knowing HTML & CSS inside and out is a valuable skill, but it is much more so combine with knowledge of JS for front end, and Java, PHP, Perl, Ruby, Python, C/C++ or C# at the back end.

Conversely, someone who only knows one of those 'real' languages without any web front end technologies, are very much limiting their own flexibility as a coder.

0

It doesn't matter. And it's also a matter of definition. What is a programming language? Some mean that it has to be Turing-complete. Others have other definitions, that make HTML a programming language. (And in your example, they weren't even called programming languages, just languages, which they obviously are).

My recommendation: Try to ignore people who point out these kinds of pointless and in many senses even incorrect claims. It's just a variation of grammar nazi-ism. Calling HTML a programming language isn't incorrect in any meaningful sense.