If HTML was the first language you have learnt like me, then I am pretty sure that it must have been a little disappointing for you after realizing that HTML is not a programming language and is a markup language instead. This means that you cannot call yourself a programmer just by knowing HTML.
However, we hear this a lot but when we actually reach out to people to ask them what's the reason for HTML not being a programming language, most of the time probably will not have any answer.
Actually it's not that straightforward either but here are the top 7 reasons why developers call HTML a non-programming language:
One of the main reasons is that unlike other programming languages, HTML is incapable of logic building. That means it's very limited to just a bunch of tags. And you cannot do all sorts of cool things you do with your other programming languages.
HTML doesn't support conditional statements like
else, which is one of the core features of probably all the programming languages I've ever known. It fails to compare values and make useful decisions out of it. I
HTML again fails to provide the facility for reusability of the code. Well, there are ways to apply CSS properties to multiple elements but as you see, it's CSS doing all the job not HTML so yeah not a programming language.
PS: CSS is not a programming language either.
HTML cannot do any maths which is not a bad thing in my opinion because then you don't have to worry about losing your mind behind those nasty operators. However, this can be seen as a disadvantage as being able to do a bit of maths is essential for a programming language. HTML is a slowly evolving language so who knows we may get some ability to do maths within HTML in near future. But for now, HTML is only as good as I am when it comes to maths.
Since HTML doesn't care about modifying our data, it is incapable of storing it either. It cannot accept any input except for the
<input> tag but that doesn't matter as the data isn't stored anywhere. Same when it comes to giving output. Yeah I know it can display text on the screen but that's not the output we are talking about. The output should be something generated step by step by the language itself & its values should differ as per the input value. Which we know it's not the deal with HTML.
This is probably something almost everyone hates & loves about HTML. Hates because it's so difficult to find the mistakes you have done into your hundreds of lines long code and loves because even if there's some mistake in a certain element, rest all the elements will be displayed on screen anyways. Now it's up to you to decide if you like this or not. However, giving reasonable errors is a good property of programming languages which we wish HTML also had.
So there we go here were the top 7 reasons HTML is not a programming language.
- What are your top reasons for not calling HTML a programming language?
- Are there any other properties you know which add to point of HTML not being a programming language?
Let us all know your thoughts and opinions on this by posting in the discussions.
Thank you so much for reading! I hope you fun reading and learnt something new today.
If you like my work please consider Buying me a Coffee so that I can bring more projects, more articles for you.