HTML is Not a Programming Language?

No Comments

HTML is just not a programming language.

I’ve heard that sentence so many instances and it’s tiring. Usually, it’s adopted by one thing like, It doesn’t have logic, or, It’s not Turing full,.so… clearly it isn’t a programming language. Prefer it’s case-closed and ought to be the tip of the dialog.

Ought to or not it’s, although?

I wish to take a look at typical arguments I hear used to belittle HTML and provide my very own rebuttals to indicate how these claims aren’t utterly appropriate.

My objective is to not show that HTML is or is just not a programming language, however to indicate that the three predominant arguments used for claiming it isn’t are flawed or incorrect, thus invalidating the conclusion from a logical perspective.

“HTML is a markup language, not a programming language”

This assertion, by itself, sounds nice… however it’s mistaken: markup languages could be programming languages. Not all of them are (most aren’t) however they are often. If we drew a Venn diagram of programming languages and markup languages, it might not be two separate circles, however two circles that barely intersect:

CodePen Embed Fallback

A markup language that operates with variables, has management buildings, loops, and so on., would even be a programming language. They don’t seem to be mutually unique ideas.

TeX and LaTeX are examples of markup languages which can be additionally thought-about programming languages. It is probably not sensible to develop with them, however it’s potential. And we will discover examples on-line, like a BASIC interpreter or a Mars Rover controller (which received the Judges’ prize within the ICFP 2008 programming contest).

Whereas some markup languages is likely to be thought-about programming languages, I’m not saying that HTML is one among them. The purpose is that the unique assertion is mistaken: markup languages can be programming languages. Due to this fact, saying that HTML is just not a programming language as a result of it’s a markup language is predicated on a false assertion, and no matter conclusion you arrive at from that premise will probably be categorically mistaken.

“HTML doesn’t have logic”

This declare calls for that we make clear what “logic” means as a result of the definition would possibly simply shock you.

As with Turing-completeness (which we’ll positively get to), those that deliver this argument to the desk appear to misconceive what it’s precisely. I’ve requested folks to inform me what they imply by “logic” and have gotten attention-grabbing solutions again like:

Logic is a smart purpose or mind-set.

That’s good if what we’re on the lookout for is a dictionary definition of logic. However we’re speaking about programming logic, not simply logic as a normal time period. I’ve additionally acquired solutions like:

Programming languages have variables, situations, loops, and so on. HTML is just not a programming language as a result of you’ll be able to’t use variables or situations. It has no logic.

That is effective (and positively higher than entering into true/false/AND/OR/and so on.), but additionally incorrect. HTML does have variables — within the type of attributes — and there are management buildings that can be utilized together with these variables/attributes to find out what’s displayed.

However how do you management these variables? You want JavaScript!

Flawed once more. There are some HTML components which have inner management logic and don’t require JavaScript or CSS to work. And I’m not speaking about issues like <hyperlink> or <noscript> – that are rudimentary management buildings and have been a part of the usual for many years. I’m referring to components that can reply to the consumer enter and carry out conditional actions relying on the present state of the ingredient and the worth of a variable. Take the <particulars>/<abstract> tuple or the <dialog> ingredient as examples: when a consumer clicks on them, they’ll shut if the open attribute is current, and they’ll open if it isn’t. No JavaScript required.

CodePen Embed Fallback

So simply saying alone that HTML isn’t a programming language as a result of it lacks logic is deceptive. We all know that HTML is certainly able to making selections based mostly on consumer enter. HTML has logic, however it’s inherently totally different from the logic of different languages which can be designed to control knowledge. We’re going to wish a stronger argument than that to show that HTML isn’t a type of programming.

“HTML is just not ‘Turing full’”

OK, that is the one we see most frequently on this debate. It’s technically appropriate (the very best form of appropriate) to say HTML is just not Turing full, but it surely ought to spark an even bigger debate than simply utilizing it as a case-closing assertion.

I’m not going to get into the weeds on what it means to be Turing full as a result of there are many assets on the subject. Actually, Lara Schenck summarizes it properly in a put up the place she argues that CSS is Turning full:

Within the easiest phrases, for a language or machine to be Turing full, it implies that it’s able to doing what a Turing machine may do: carry out any calculation, a.ok.a. common computation. In spite of everything, programming was invented to do math though we do much more with it now, in fact!

As a result of most fashionable programming languages are Turing full, folks use that because the definition of a programming language. However Turing-completeness is just not that. It’s a criterion to determine if a system (or its ruleset) can simulate a Turing machine. It may be used to categorise programming languages; it doesn’t outline them. It doesn’t even apply solely to programming languages. Take, for instance, the sport Minecraft (which meets that criterion) or the cardboard recreation Magic: The Gathering (which additionally meets the criterion). Each are Turing full however I doubt anybody would classify them as programming languages.

Turing-completeness is trendy proper now the identical method that some previously thought-about the distinction between compiled vs. interpreted languages to be good standards. Sure. We don’t should make an enormous reminiscence effort to recollect when builders (primarily back-end) downplayed front-end programming (together with JavaScript and PHP) as not “actual programming.” You continue to hear it typically, though now pale, mumbled, and muttered.

The definition of what programming is (or is just not) modifications with time. I guess somebody sorting via punched playing cards complained about how typing code in meeting was not actual programming. There’s nothing common or written in stone. There’s no precise definition.

Turing-completeness is a good commonplace, I have to say, however one that’s biased and subjective — not in its kind however in the best way it’s picked. Why is it {that a} language able to producing a Turing Full Machine will get riveted as a “programming language” whereas one other able to producing a Finite State Machine is just not? It’s subjective. It’s an excuse like some other to distinguish between “actual builders” (those making the declare) and people inferior to them.

So as to add insult to harm, it’s apparent that lots of the folks parroting the “HTML is just not Turing full” mantra don’t even know or perceive what Turing-completeness means. It’s not an award or a seal of high quality. It’s not a badge of honor. It’s only a technique to categorize programming languages — to group them, not outline them. A programming language could possibly be Turing full or not in the identical method that it could possibly be interpreted or compiled, crucial or declarative, procedural or object-oriented.

So, is HTML a programming language?

If we will debase the principle arguments claiming that HTML is just not a programming language, does that truly imply that HTML is a programming language? No, it doesn’t. And so, the talk will stay on till the HTML commonplace evolves or the “present definition” of programming language modifications.

However as builders, we have to be cautious of this query as, in lots of instances, it isn’t used to spark a critical debate however to stir controversy whereas hiding ulterior motives: from getting straightforward Web reactions, to dangerously diminishing the contribution of a gaggle of individuals to the event ecosystem.

Or, as Ashley Kolodziej superbly sums it up in her ode to HTML:

They are saying you’re not an actual programming language just like the others, that you just’re simply markup, and technically talking, I suppose that’s proper. Technically talking, JavaScript and PHP are scripting languages. I keep in mind when it wasn’t cool to know JavaScript, when it wasn’t a “actual” language too. Generally, I really feel like these distinctions are meaningless, like we constructed a vocabulary to carry you (and by extension, ourselves as builders) again. You, as a markup language, have your personal distinctive worth and strengths. Understanding methods to work with you greatest is a real experience, one that’s too usually neglected.

Unbiased of the stance that we tackle the “HTML is/isn’t a programming language” dialogue, let’s rejoice it and never deny its significance: HTML is the spine of the Web. It’s an attractive language with huge documentation and intensive syntax, but so easy that it may be discovered in a day, and so advanced that it takes years to grasp. Programming language or not, what actually issues is that we now have HTML within the first place.

The put up HTML is Not a Programming Language? appeared first on CSS-Tips. You may assist CSS-Tips by being an MVP Supporter.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment