DEV Community

Discussion on: Are CSS and HTML programming languages?

Collapse
 
comaldave profile image
David Skinner

I say it is a language some people are very fluent. SCSS 4.6+ has conditionals and computations and variables, what more do you want from a language. GoHtml5 templates lets you add shortcode to your HTML, put header in one file footer in another, what more do you want. GoHugo MarkDown you are just typing text, and specifying class and variable and parameters and database values, even Go shortcode if you are a bit crazy. I think that makes it a language.
TOML is a very simple language defined in maybe 100 lines. Go is a simple language requiring 100 pages simple compared to C++ which requires an encyclopedia.

Forth is not a language, it is a compiler that lets you create your own language that no one else can read 🤓

Collapse
 
themoviemadman profile image
Eliseo D'Annunzio

The only problem there is that pre-processors like SCSS and SASS require a third-party piece of software to act as the compiler. The same goes with HTML add-ons like HAML which sit on top of HTML, HAML being written in Ruby...

So, while The Mine may compile into CSS and HTML they were written using non-CSS/HTML extras on top of the original HTML/CSS application...

Having been in the industry for 25 years, I’ve seen HTML and CSS evolve over that time. CSS3 now having CSS custom properties (aka “CSS variables”) and HTML having more flexibility since it made its debut. With a little creativity and “use and abuse” of the way CSS works, you can do a lot with CSS and HTML to make them work programmatically.

I’m currently in the process of taking a proof of concept for a BCD to LCD converter I created to create a CSS/HTML Calculator (codepen.io/zerosumgames/pen/axrxMV for the converter)

Here I make use of the concept of a 4 bit register and Boolean equations to convert the 4 bits needed to represent the digits 0 to 9 and created an LCD circuit capable of displaying the number as you would on a calculator.

To extend this further will require taking this concept for 32 bit numbers, I’ve yet to decide whether I’ll be going with an integer based calculation or considering decimals overall, but the concept is possible using logic gates and algorithms over a 32 bit register system. But I believe this to be possible. HTML may only be seen as a structural placement language and CSS may be seen as only a design-orientated presentation language, but given what they are when they come together, they can be seen as a programming language when working symbiotically. It’s just a matter of working within the limits of what they are able to do together.

CSS and HTML may not necessarily be programming languages on their own but nowadays they are more than capable of working together as a programming language system.