DEV Community

loading...
Cover image for So, how many of you respect CSS as a programming language?

So, how many of you respect CSS as a programming language?

starbist profile image Silvestar Bistrović ・1 min read

Last week I posted a poll on Twitter about respecting CSS as a programming language. I don't want this to become a discussion whether CSS is or isn't a programming language (apparently it is a scripting language, thanks for the comments). I just want to learn how many of you respect it in terms of writing it correctly and responsibly.

Twitter post

So, what is your answer?

Discussion (98)

pic
Editor guide
Collapse
afif profile image
Temani Afif

people need to understand that CSS is a must because you simply cannot do front end without CSS and CSS is the only language for this purpose. You can choose between a huge number of backend language but you are stuck with using CSS for the front end so we have to respect it ;)

Collapse
urielbitton profile image
Uriel Bitton • Edited

This is quite false. There are many other technologies that can style a UI besides for css. Native Javascript can style a UI (although it compiles to css, true), react native's stylesheet api can style UIs as well (without compiling to css). There are a few more you can find out there too (like flutter's styling, all mobile dev styling, etc)... you just need to do more research when unsure ;)

oh and also CSS is not a programming language, see my comment below.

Collapse
afif profile image
Temani Afif

Whataver the technologie/the tool you will be using there is always CSS behind the scene. If you will create something that need to run inside a browser then you need CSS even if you will not write any single line of CSS because a tool is doing this for you.

Browsers understand one unique language for styling and it's CSS.
It's like people that tell they never use JS because they write only jQuery but jQuery is JS

Thread Thread
chakudi profile image
Vaishali JS

Well said!

When you are talking about front-end in web browser or any web based platforms, CSS is the only language that works for styling the UI. All other tools are using CSS behind the scenes.

Looking at the number of tools we have today, we can say, knowledge of CSS is not must but at least good to have and you need to respect CSS 👍

I ♥️ CSS

Collapse
anilsansak profile image
Yaşar Anıl Sansak

If I am not wrong the technologies you list uses the CSS rules. So, isn't it the same thing? I might be completely wrong here and if I am, I would like to correct myself.

Thread Thread
kieran815 profile image
Kieran815

right. all .style does is allow js to read css. Same for styled components for react.

Thread Thread
urielbitton profile image
Uriel Bitton

No. Again wrong, please read my comment. Not all technologies compiles to css. React native's styling is one example, another is flutter. Many mobile development technologies cannot use css for styling as they are not html based (or for other reasons). They use their own styling technology.

Thread Thread
afif profile image
Temani Afif

@urielbitton If you will not run it in a browser then logically you won't use HTML/CSS, this is trivial. CSS will not style everything. Here it's about front-end dev which is closely related to browser.

My point was that if you are going to deal with CSS then it's CSS, you don't have another choice. You can change your backend language, the Database, etc but you have no alternative to CSS. Using another technologie is another story. If you will do Robotic then you won't need CSS which is trivial. I never said CSS is everywhere.

Collapse
lifelongthinker profile image
Sebastian

Sorry, Uriel, but I think you are wrong.

JS can style only through basic CSS.

I'm not too familiar with React, but would be pleasantly surprised if it did not at one point compile to/use CSS.

Thread Thread
urielbitton profile image
Uriel Bitton

Even if it does, this is why i listen other examples like mobile dev styling, like flutter, react native, they don't use css. Sorry but i am not wrong on this. Research this, not everything is styled with CSS.

Thread Thread
kieran815 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Kieran815

Hey, there's an animation library you should check out. It's called WankerJS. It's really just a one line method for removing the "wanker" class from any Dom elements that are class "Wanker". As we all know, the "Wanker" class adds an opaque overlay on all it's child elements, which is obnoxious if you're styling with css or scss. Enjoy!

Thread Thread
kieran815 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Kieran815

Don't be so opinionated. You learned css past year. Did you really JUST learn media queries???
dev.to/urielbitton/the-top-5-css-t...

Thread Thread
urielbitton profile image
Uriel Bitton

I have known css for 8 years or more. These are only concepts i took seriously last year. You can know basic css and use css libraries for web development, or use older css methods...

Thread Thread
urielbitton profile image
Uriel Bitton

Also be respectful please. Your comment is not appropriate on DEV, be more respectful when writing comments in the future.

Thread Thread
lifelongthinker profile image
Sebastian • Edited

@urielbitton , React Native doesn't apply here as it doesn't target web browsers. Unless the "frontend" definition relates to technology beyond HTML rendered by web browser, which makes the entire discussion here pointless.

Flutter can target web apps and I see an awful lot of CSS in their output. It uses the HTML Canvas control, where CSS might not apply, but then that is not targeting traditional HTML.

Bottom line, what you are referring to as "they don't use css" looks a lot like the concept of an additional layer of abstraction ON TOP of CSS. True, those exist (and reasonably so), but they transpile to CSS.

Maybe we should ask a different question here: What other means exist besides CSS to tell browsers how to style DOM elements? I can't think of any besides the "good" old HTML2/3/4 elements and properties such as FONT, TABLE border cellpadding, etc.

kieran815 profile image
Kieran815

So you only learned it starting last year. Gotcha.

Thread Thread
kieran815 profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Kieran815

Yawn.

Thread Thread
urielbitton profile image
Uriel Bitton

If you actually read the post you would know i learned you can use max-HEIGHT and not just max-width which i knew from many years ago...

Collapse
starbist profile image
Silvestar Bistrović Author

Exactly. CSS is everywhere, but I don't see people care enough.

Collapse
atulcodex profile image
Atul Prajapati

That's the reason the reason, they are always searching something on Google 😂

Collapse
icecoffee profile image
atulit023 • Edited

CSS is a programming language so is the HTML, most of us just don't know the definition of programming.

Collapse
trueneu profile image
Pavel Gurkov

And not the definition of language.

Collapse
mzaini30 profile image
Zen

Stuck 🙈

Collapse
atulcodex profile image
Atul Prajapati

You are right brother 🙏

Collapse
urielbitton profile image
Uriel Bitton • Edited

This isn't actually a topic for discussion...a programming language in computer science is defined by a technology that is referred to as "Turing Complete". Some examples are classic languages like java, JS, python. I won't go into the long details of a turing compelte language but in basic terms it is a language that can run a 'tape' forward and backwards and possesses the principle idea of The Halting Problem- this means there's no algorithm for determining whether a program will finish running or loop forever. But anyone who knows CSS knows it does not and cannot loop forever and therefore solves the halting problem and so we can conclude CSS is not Turing Complete.

As CSS is not turing complete it is NOT a programming language and should not be respected as a programming language.

Note: i love css and have done amazing things with it so i respect css as a technology but ultimately it isn't a programming language.

EDIT: i definitely DO encourage discussion, that is not what i meant, i simple mean whether it is a programming language or not is not a discussion but a hard fact. Sorry for any misunderstandings!

Collapse
darkwiiplayer profile image
DarkWiiPlayer

a programming language in computer science is defined by a technology that is referred to as "Turing Complete"

And who exactly is "computer science"? I agree that CSS is not a programming language, but not because some magic CS authority claims it to be. Everyone in this community is to some extent part of CS and has an influence over the language we use.

This isn't actually a topic for discussion

It very much is, precisely because the CS community seems to be quite split on this question.

But anyone who knows CSS knows it DOES solve the halting problem and so we can conclude CSS is not Turing Complete.

This is a smaller nitpick, but CSS doesn't "solve" the halting problem; it's that the halting problem doesn't exist for CSS because it is, as you've pointed out, not turing-complete.

[CSS] should not be respected as a programming language.

That phrasing is a bit ambiguous. I'd say CSS should not be respected for being a programming language (because it isn't), but it should be respected just as any programming language would.

Ultimately, being turing-complete is a very technical way for classifying languages, but it doesn't tell us how difficult or powerful it is.

Collapse
trueneu profile image
Pavel Gurkov

That's not exactly how science works. Not everyone in this community is a part of Computer Science. I think I can safely assume most of us aren't. The same as talking about quantum mechanics doesn't make me a part of Quantum Physics as a scientific field. Publishing high quality white papers in a peer-reviewed science journal, on the other hand, kinda goes hand in hand with scientific method.
The fact that the community is split on this question shouldn't matter. Some people still question special relativity, or general relativity, or think that the Earth is flat. Does this change anything regarding those theories itself?

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

I think I can safely assume most of us aren't

You're saying a community called "dev" is mostly visited by non-developers? You realize terminology isn't unilaterally decided by academia, right? Whether you're "just" a javascript developer, or a researcher who's written 10 books makes no difference here.

Thread Thread
trueneu profile image
Pavel Gurkov
  1. I wasn't saying anything about developers or non-developers. I was saying on being part of CS. Let me try a different example: writing fan fiction doesn't make you a part of literary theory.
  2. Terminology is decided by someone or something, whether it's academia or not, and if we do not define a term in a clear, non-amibguous way, we cannot use it. Which term are you talking about?
  3. When you say it makes no difference here, which here do you mean? Do you mean this community? Or this discussion? Or do you mean that CSS being a programming language is a question we should vote on, and it doesn't matter who the vote comes from?

I'm sorry, but it does make difference to me. To each and any sentence I will apply my critical thinking, and I always leave the possibility that a neophyte is brighter than Edsger Dijkstra. However, the probability is quite, quite low.

Collapse
urielbitton profile image
Uriel Bitton • Edited

It is not some magic authority on CS that claims this. This is a fully accepted concept by EVERY computer scientist in the world..
If the halting problem doesn't exist for CSS that makes it non turing complete as well.

It does not need to tell us how powerful it is (eventhough it is) it is simply about being turing complete or not, power is irrelvant here.

Collapse
fnh profile image
Fabian • Edited

There are many artefacts that are necessary to create a working software system. I assume we agree, that CSS is indispensable for web applications. I'm not quite sure about the formal properties of CSS with regard to the Chomsky hierarchy. It is a formal language with grammar, semantics and established idioms (and not under-complex). I have read, that some of the recent additions made CSS actually indeed Turing-complete, but I cannot back that up formally.

But allow me to quote the first recipient of the ACM Turing award, Alan Perlis, on this issue of Turing completeness. In a paper collecting epigrams on software engineering, he wrote: "Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy."

I personally have a whole lot of respect for those who actually master CSS (I don't count myself among them). Since I expect the web as an application platform to stay around and thrive for quite a few more years, I think any person who is able to write good CSS will not be out of work anytime soon.

Collapse
kallmanation profile image
Nathan Kallman

CSS is turing complete so.... even by your definition it is a programming language.

Collapse
darkwiiplayer profile image
DarkWiiPlayer

Try scrolling down to the second answer on that SO question; it makes a fairly good argument for why CSS isn't turing-complete at all.

Thread Thread
urielbitton profile image
Uriel Bitton

But that's exactly what i'm saying as well haha

Collapse
urielbitton profile image
Uriel Bitton

It is not turing complete. If you read my comment, i prove it solves the halting problem, therefore by deduction it is not turing complete...

Thread Thread
kallmanation profile image
Nathan Kallman

CSS can encode Rule 110
Rule 110 is known to be Turing complete
QED: CSS is Turing complete


To comments about halting; to actually "compute" in CSS requires "pumping" (clicking or key taps). This is not substantively different than the "pumping" a clock does to our computer chips (they just do it "automatically"). Yes CSS will halt for any given execution cycle between these "pumps"; but comparing that to the halting problem in general means that I can argue our CPUs are not Turing complete because they are guaranteed to complete execution of any single instruction. If CSS is not Turing complete neither is my computer and by extension any programs executing on it.

Collapse
lifelongthinker profile image
Sebastian

Whether or not you consider CSS/HTML/whatever a programming language is up to your definition of "programming language". The "turing complete" idea is just one possible criterion, albeit a reasonable one.

Ask five computer scientists (you mentioned CS) and you get six differing opinions on this.

The more important question, I believe, is: Who cares? What is the relevance of finding an answer to that question?

Collapse
ajxn profile image
Anders Jackson

IF no one cares, why ask?

And consensus among CS is neither HTML not CSS are proper programming languages.

That doesn't means that their specifications should not be respected and followed.

I have used HTML from Winter 1992-93 and have ALWAYS tried to respect the specifications behind HTML and CSS when it later came to remove the font tag and table missuse at sites.

So no, a specifications doesn't need to be a programming language to earn respect from programmers.

And No, many/most programmers are good programmets even with vital and huge black holes in their CS knowledge.
That doesn't make them worse programmer.

I also know good CS researchers that have equally huge holes in how one write good programs.

Computer science and being a scientists in that fieald is about understandings and searching for new ways of solving problems.

Being a programming is about using good practices and technologies to solve problems. Not search for understandings and new ways of solving problems.

They overlap, but not totalt.

So again, neither HTML nor CSS are programming languages, and that is fine.
They solve a real problem.

Collapse
collingskenny profile image
Kenny Collings • Edited

I do not think a programming language needs to be turning complete. In fact, I don't think "computer science" defines what a programming language is.

Computer science, however does define a formal language. From the bible of computer science, Introduction to Algorithms, "a language L over [an alphabet] is any set of strings made up of symbols from [that alphabet]." Basically, any series of words made using a defined set of letters is a language. This is incredibly broad. A language can include everything from the null language (a language of nothing), to turning complete languages, to even human languages like english. In automata theory, the simplest languages defined is the language of a DFA, or a regular language. DFAs, by definition, do not have to be turning complete.

If however, we want to define what a programming language is we have to go broader. From the bible of the internet, Wikipedia, "A programming language is a formal language comprising a set of instructions that produce various kinds of output." By this definition CSS IS A PROGRAMMING LANGUAGE. It is a formal language (see definition above) and it's set of instructions provide an output that shape the web in beautiful ways.

From my understanding of computer science, turning completness is a descriptor of some programming languages, not the other way around. Programming languages come in all shapes and forms, from regex to javascript, from html to scratch.

I am far from an expert in this field, and this is my interpretation and understanding of mathematics, so please correct me where I am wrong! Programming languages are really cool and I think it is amazing that computer science is really just an offshoot of linguistics! 😁 Have a nice day!

Collapse
ajxn profile image
Anders Jackson

About the first definition about formal language.

Not all languages are computer languages, even if they fall in that definition like HTML or regular expressions. Nor is grammar like LR(1) or LL(n) grammars, even if they can be used to define grammar of programming languages.
You see, DFA and grammars are important tools to make usable programming languages.
And all languages doesn't need to be abel to be described with DFA and with grammars. Like FORTRAN IV.

DFA and grammars and HTML and CSS are still not part of the sub group of languages that is programming languages.

Collapse
iamschulz profile image
I am Schulz

This is such a tired discussion.

CSS is a programming in every sense of the word. You can write programs in CSS.

  • Going for Turing completeness? Here you go: eli.fox-epste.in/rule110-full.html
  • Algorithms? You have things like Grid, Flex, Float, etc.
  • Logical operators? That's media queries and pseudo selectors for you.
  • Loops? Try :nth-of-type(2n)
  • Variables? --try: nice;
  • CSS only Games? Sure
  • Trying to tell me that CSS isn't a programming language, because it relies on HTML? That's a moot point. Javascript relies on a browser or node in exactly the same way.

CSS is a declarative programming language. Keith Grant wrote about that in 2018. It's a different paradigm than the likes of Javascript, PHP and co, thus often misunderstood. It's a programming language nonetheless. CSS developers are programmers and deserve to be acknowledged as such.

Collapse
darkwiiplayer profile image
DarkWiiPlayer

What I find so annoying about this debate is that one side desperately wants to call CSS a "programming" language so people who only do CSS can still be "programmers", while the other side wants it to not be programming, so they can keep the club more exclusive.

Both positions are extremely stupid because, at the end of the day, whether or not the label applies won't change the language, nor the skill you need to master it.

I think the debate should be "Can we compare CSS with Programming?". And I'd say yes; being really good at CSS isn't worth less than being really good at programming. For both you need to be smart, to have a good mental model of the internal logic of the language, to put in the effort to learn the tools and best practices, etc. etc. etc.

Collapse
ajxn profile image
Anders Jackson

Amen.

This is why the will to define CSS as a programming language or not is moot in this context.

People that code in CSS should be respected for the work they do solving problems. That isn't more or less important for the final sollution.

People should be respected as Long as they are good with what they do.

So yes, if CSS or HTML is programming languages should not matter if you and your work should be respected.

I do have much more respect of a good CSS coder then a bad Java programmer.

Collapse
sshine profile image
Simon Shine

There is actually a reasonable angle to "CSS is not programming":

  • It is a declarative, domain-specific language
  • It is Turing-complete
  • That technically makes it a programming language, much like Minecraft then becomes a programming language because Redstone is Turing-complete.
  • The intent of CSS can be discussed, but uncontroversially: It is a styling language, like HTML is a markup language. Those are domains with supposed, intended limitations that got fuzzy over time.

The idea that a language isn't a programming language is not intended as degrading towards those who know it. It is intended to scope off the intent and purpose. A limited purpose makes a language more powerful for specificaly that purpose. Being general-purpose is not the holy grail of all languages. Most of my favorite languages have extremely limited scope: jq, regex, sql.

If you can write a 3D game in CSS, or an infinite loop in PCRE in spite of real regular expressions always being representable as finite automata, power to you. I hope it never reaches production. ;-)

Collapse
joelbonetr profile image
JoelBonetR • Edited

CSS is not a programming language, i don't know why we need to argue about that in 2021. A programming language is that which lets you program things. With CSS you can only style the output of that things. It's own name tells you all Cascading Style Sheets. It is, declarative styling language, nothing else, even being able recently to style things different according to some situations you still cannot program things with it.

Apart from that I really like CSS and it's a must. Even being alternatives to style elements (which in the end, rely on CSS), there are none that is performing better than CSS and it's pretty clear once you learn about it enough.

Collapse
peerreynders profile image
peerreynders

MDN Web Docs Glossary:CSS:

A CSS rule is a set of properties associated with a selector.

Digging deeper...

Martin Fowler Bliki: RulesEngine:

A rules engine is all about providing an alternative computational model. Instead of the usual imperative model, which consists of commands in sequence with conditionals and loops ... rules, each of which has a condition and an action - simplistically you can think of it as a bunch of if-then statements.

i.e.:

  • Selector lists are conditions.
  • Property lists are actions.
  • Specificity and source order govern rule priority.

So in writing CSS you are composing rules for a domain specific rules engine which drives the visual design of the page - what is not to respect?

Collapse
ajxn profile image
Anders Jackson

Can you transfer a CSS program into a Turing machine? Is it eqvivalent to Turing programming language?

IF you can prove that, THEN CSS is a programming language.

Prolog is a logical declarative PROGRAMMING language, and Still are declarative.
Being declarative, as plain SQL also are, doesn't make it a programming language. As SQL neither are.

Does that mean that People that are skilled in CSS or SQL are worth less respect than those skillfull in Prolog or JavaScript?

Of course not.

The original question is made so it start this toxid thread.

CSS are not a programming language, and that is fine. And that doesn't make CSS not SQŁ less important.

Collapse
starbist profile image
Silvestar Bistrović Author

Thank you for your answer. This isn't what I meant, but it is the most accurate answer, I think.

Collapse
mrdanielschwarz profile image
Daniel Schwarz

Well, the “is [x] an [x] language?” debate is nothing more than an egotistical one, a way for narcissists to obtain their daily fix of attention and admiration.

In reality, nobody actually cares. I don't care, and I don't know the answer either. I don't need to know the answer. All that matters is, can you write decent code or not?

In my opinion, the only way to respect CSS is to write vanilla CSS. That is, in between <style>...<style> tags or as a .css stylesheet. JavaScript, React, etc. is a terrible approach and the only developers that think otherwise fundamentally don't understand how the web works.

HTML, CSS, and a little bit of JavaScript is all we need. Sometimes not even JavaScript.

Collapse
buscedv profile image
Edvard Busck-Nielsen

Well, I do respect CSS but it's definitely not a programming language by any sense of the word. That part is clear at least...

Collapse
afif profile image
Temani Afif

but it's the most important part of a work. No one will care about your database structure or you files structure or how you create you Classes, etc but everyone will care about how it looks and it must look good (good UI, good UX, etc).

Collapse
gegenokitaro profile image
Rizal M. S.

I'm still debating whether which statement is partially true or wrong in this discussion but I can confidently say that this comment which I replied to is definitely wrong whether as an opinion or a fact.

Collapse
trueneu profile image
Pavel Gurkov

What value does form have without content?

Collapse
ajxn profile image
Anders Jackson

And if my databasen doesn't work and produces wrong answers or take way to long.
No one will use you UI neither.

I take a basic UI before a malfunction application any Day of the week.

I take a reasonable working application with a great UI before the great with a basic UI also all days of the week, as Long as it works ok.

Basic proper function IS most important.
A pig with geat makeup is still a pig.

But yes, when you have working base, UI makes a difference.

Thread Thread
afif profile image
Temani Afif

will you release a non-working App or an App that take one year to load? I don't think you will do such thing. Identifying a wrong App and functionnal issue is something formal (either it work or not) but when it come to UI it's a different story.

You can spend days building an UI you think is good but later no one will use it because it's bad.

No one will accept a fast App with a bad UI but everyone may accept a laggy App having a perfect UI.

Thread Thread
simmol profile image
Pavlin Angelov

No one will accept a fast App with a bad UI but everyone may accept a laggy App having a perfect UI.

I guess you have no experience in Finance world :) Not everything is IPhone app...

Collapse
patferraggi profile image
Patricio Ferraggi

Does css care about my respect? Does it matter if it is a programming language or not? Don't we have more important stuff to care about?

Collapse
starbist profile image
Silvestar Bistrović Author

Thank you for your comment. I would say that this attitude brought us here. CSS cares because if you respect CSS we wouldn't see so many “bad” CSS code out there.

Collapse
patferraggi profile image
Patricio Ferraggi • Edited

I don't agree with that statement, caring if a tool is a programming language or not doesn't prevent developers for not caring about the quality of their work. You should bring your best doesn't matter what the tools are. CSS doesn't care because it is a tool, just as c# or my phone that I am using to answer this. Tools don't care, people care. We need to teach developers to value their work, not their tools.

Collapse
ajxn profile image
Anders Jackson

You are wrong.
It is respecting the specifications and definition that is needed.

That was what went wrong with HTML in the beginning.
That is also why we have so much uggly code. People doesn't respect the definitions of the programming languages.

So no, to wrongly define CSS as a programming language will not solve your problem.

Collapse
jonthanfielding profile image
Jonathan Fielding

As someone who grew up in the industry very much CSS and HTML first I have a lot of respect for both HTML and CSS. It is incredibly powerful and one thing I want to see in the industry is rather than people thinking its a chore, I want people to be enjoying writing awesome CSS

Collapse
simmol profile image
Pavlin Angelov

Is hard to enjoy it when is very hard to understand and argue what would be the end result of some styling without running it in the browser and sometimes even then...

Is just too powerful at times :)

That said more Power to people that enjoy that, but to ask for everyone to enjoy it is fool erand. There is not a thing on earth that all people enjoy ...

Collapse
starbist profile image
Silvestar Bistrović Author

Well said, thank you.

Collapse
darkwiiplayer profile image
DarkWiiPlayer

I don't consider it a programming language, for reasons that I've often enough explained elsewhere.

It is, however, an extremely underrated tool. You will often find me complaining about "CSS Frameworks" and how they actively try to undo everything CSS has done for HTML.

I've seen sooo many examples of ugly code where people try to fix problems algorithmically, like adding .a and .b classes to table rows, instead of just defining a class for the whole table and using tr:nth-child(even) to style every second row separately, or filtering through the DOM to add some bootstrap/uikit/whatever class to some elements instead of just coming up with a few declarative rules.

Collapse
devlorenzo profile image
DevLorenzo • Edited

CSS is very cool, you can fairly advanced things with it. Preprocessors improve writing by a lot.
As a scripting language CSS is the one all devs use, without concurrence. It's very well done and organized. I very love it.
But I have to add that CSS is not a programming language 🙃

PS - Can you please send me your Twitter profile link?

Collapse
darkwiiplayer profile image
DarkWiiPlayer

But I have to add that CSS is not a programming language

Outside of software, program and script mean very similar things; both usually describe an order of steps or actions that will be taken one after another, which doesn't apply to CSS.

Any reasoning to consider CSS a scripting language could be used as well to consider it a programming language.

Collapse
starbist profile image
Silvestar Bistrović Author

Thanks for the comment. I agree that CSS is cool, but I think it is ignored sometimes.

Here's my Twitter link: mobile.twitter.com/malimirkeccita

Collapse
lionelrowe profile image
lionel-rowe • Edited

I respect CSS for the flawed masterpiece that it is.

CSS is a wonderful, powerful language that is fundamentally broken with regards to styling UI. Its "everything global all the time" design makes it very difficult to reason about, easy to break styling elsewhere in your app, and has led to all sorts of awkward workarounds such as BEM.

That's why I almost never use CSS on its own, without some nice abstraction that provides scoping.

WebComponents with shadow DOM work well if you want very strict scoping, but more commonly you'll want a few global styles (such as fonts) to be able to affect the inner scope, while preventing any of the inner styles from leaking.

JSS works really well for this, as do Vue or Svelte's scoped style tags.

All these solutions are built on top of plain old CSS, so you get all the power of CSS without the drawbacks.

Collapse
johnkazer profile image
John Kazer

I spend futile time wondering what we would use for styling apps and pages if we started again from scratch.

Collapse
unsungnovelty profile image
Nikhil

I love that people don't like CSS. Just leverage for other people! :evil_smile:

Personally I have been fascinated by it because when I first when I was 12 or 13, there was only HTML 4 (for me. CSS was not something that was popular in school curriculums, at least not in mine! ) and I used to go nuts on my school computer with HTML 4 and it's "capabilities".

When I started learning HTML recently, CSS became a key factor. Obviously the landscape has changed with great capabilities. CSS, SASS, Animations, CSS Grid and Flexbox. When I hear people hating CSS, it obviously because they don't know how to tame it. CSS is brutally honest you know. Tolerance is the key I guess. :)

Collapse
ajxn profile image
Anders Jackson

Agree.
HTML is about the structure, or should att least be.
This is actually a table, this is a paragraph and this is din titel and sub sub titel etc.

The look, should all be in the CSS.

I do have full respect for people that can make design magic with CSS and a plain HTML file, not so much of People that uses tables to make a page "look right". Never hade.

Have hade that since from the start, because it broke the meaning of HTML. Also, I played with the first CSS support in the 1990:th too. I saw the light from the beginning there...

But then I also wrote LaTeX before HTML was presented.

Yes, I codes CGI in Python before 1995...

Collapse
unsungnovelty profile image
Nikhil

I do have full respect for people that can make design magic with CSS and a plain HTML file.

I've kept my personal website html and css only too - unsungnovelty.org/. I will add JS when there is a need for it.

But this is normal to tech industry in general though. We don't utilise things to it's true potential. We move around looking for the silver bullet even after getting the silver bullet! The apps we use, the technology that we use to power products are never utilised for it's full potential. And then we get amazed when someone use it to it's full potential. :D

Collapse
alexmercedcoder profile image
Alex Merced

I people are nitpicky about the word programming, cause CSS is definitely a language and a very important one.

HTML and CSS may be better characterized as Markup Language like Markdown (Languages that "markup" or describe/manipulate content)

Kinda like Pug, EJS, Mustache can be called Templating Languages

Or TOML, YAML are also MarkUp Languages that are used more for configuration files.

They have a syntax, they communicate things, they are a language.

I think people are just sensitive about the word programming.

At the end of the day, it's fairly meaningless. All these things are important technologies that take time to master and effective use of them is important.

Collapse
moopet profile image
Ben Sinclair

I'm not sure what you're getting at.

You've very deliberately used the word "respect" several times, and phrased the response choices in a leading manner - it's a dark pattern ("confirmshaming") meant to push people away from the negative response, and it'll skew your results.

CSS has some features of a programming language and some of a descriptive one.

In addition, the way people use CSS is often through a higher-level abstraction, like a framework (e.g. Bootstrap), a preprocessor (e.g. Sass), CSS-in-JS (e.g. React) or through applying attributes directly to DOM elements in Javascript rather than writing a separate stylesheet.

It's enmeshed in web development, to the point that a lot of frameworks use HTML elements attributes to describe the page look and feel and plug in a pre-made CSS library instead. I guess you could say that non-semantic styling is disrespecting CSS if you were stretching for a soundbite.

Collapse
alaindet profile image
Alain D'Ettorre

I respect CSS, I work intimately with that every day, I wrote libraries about it, but it's not a programming language and I'm not saying that in a dimishing way, it's simply not, like in "the color blue is not red".

Collapse
mzaini30 profile image
Zen

I respect SCSS

Collapse
nikolab profile image
Nikola Betica • Edited

It's a scripting language. You could create a new twitter poll and share a link.

Collapse
starbist profile image
Silvestar Bistrović Author

Thanks for the comment.
Do you think it is worth it to create a new Twitter poll?

Collapse
ajxn profile image
Anders Jackson

Not of you ask the wrong question.

It doesn't matter IF you call CSS a programming language or not.

People using CSS need to respect their own work, and try to do the best they can.

There are lots of bad code, in programming languages and CSS. So IF it is a programming languages have nothing to do with it.

Collapse
nikolab profile image
Nikola Betica

Well, surely you'll get more than 10 votes 😄

Thread Thread
starbist profile image
Silvestar Bistrović Author

Yeah, I am not too popular on Twitter. ☺️

Collapse
guitarino profile image
Kirill Shestakov • Edited

I don't want this to become a discussion whether CSS is or isn't a programming language

And... comments proceed to do exactly that 🤣

In seriousness, what do you mean by "respect"? Follow good conventions and code patterns?

Collapse
infinitewaves profile image
Infinite Waves • Edited

Hi Silvestar,

I’m not sure it’s about respect. I’d say it’s firstly more about competence. Does a developer have the necessary knowledge and skill to produce CSS firstly that works, and then is as efficient as they can make it with their level of experience and understanding?

If they are competent, then the question becomes that of a given individual’s desire to produce CSS to the best of their ability or if they want to cut corners or not be concerned with optimisation.

Working on your own projects this is probably not as big of a deal as if you’re part of a team, and others have to work with your code.

Having said that ‘correctly’ and ‘responsibly’ are pretty subjective. The flexibility of CSS makes it so that you can achieve the same result in multiple ways and it might not necessarily be clear which is the ‘best’. In that case it becomes about agreeing on a convention that makes the most sense for your team/project.
I always find everyone has their own style and idiosyncrasies with CSS.

Collapse
kevindsteeleii profile image
Kevin Steele

The title was written to reiterate the tweet this post originated from. That being said, the very last thing written by the writer of the post was,
"I just want to learn how many of you respect it in terms of writing it correctly and responsibly".

So those of us who took the "technically correct train" not only missed their stop but were going in the wrong direction in the first place. This post was not about CSS being a language, it was about caring to do it correctly and responsibly, ie "giving a sh*t".

Collapse
ajxn profile image
Anders Jackson

Yes, the train went in the wrong track the minuter the author added Programming language to the mix.

HTML are languages, but not programming languages.

Collapse
tankerguy1917 profile image
tankerguy1917

I dont see why anyone wouldn't respect it. Without CSS, we wouldn't have many pretty websites, and things would probably get boring and it would be more challenging to tell what website you are on.

Collapse
dn_josh profile image
Dumte

From my standpoint, css is a programming language in that it determines how the content on a page or a program is displayed on the UX/UI. It has its own syntax just like the python, c#, c++, JavaScript etc.

Collapse
ajxn profile image
Anders Jackson

Yes, we all can define our own meaning to Words.
It doesn't help promote understandings through.

Collapse
lifelongthinker profile image
Sebastian

CSS is very good at what it does. But it is hardly manageable beyond a certain size without the help of preprocessors.

With those, though, it is a marvel of web technology.

Collapse
kieran815 profile image
Kieran815

The most surprising thing about this thread is that I read almost all the way to the end before someone even mention Sass...

Collapse
pozda profile image
Ivan Pozderac

In my book you can be god of programming but if you don't know how to CSS I will never acknowledge you as a legit frontend/fullstack web developer.

Collapse
trueneu profile image
Pavel Gurkov

Well... It's not a programming language as it's not Turing complete, so it cannot be respected in this regard in any way.

Collapse
jmau111 profile image
Julien Maury

CSS is everything, any web developer should start by that even if you're more fond of the backend stuff.

Collapse
menaiala profile image
Menai Ala Eddine

I don't know why you called CSS as programming language ? while it's a Stylesheet Language !

Collapse
retr0c0de profile image
Anguram Shanmugam

absofruitly...

Collapse
ra1nbow1 profile image
Matvey Romanov

I respect CSS!

Collapse
nikhilmwarrier profile image
Nikhil M Warrier

Alert: It's a warzone out there...

Whatever, but I love CSS

Collapse
bogdandevbst profile image
Bogdan Niculescu

There is a difference between programming and coding language. In my opinion CSS is a coding language.