Slashdot Mirror


CSS Selectors as Superpowers

An anonymous reader writes "Simon St. Laurent writes in praise of CSS selectors: 'After years of complaints about Cascading Style Sheets, many stemming from their deliberately declarative nature, it's time to recognize their power. For developers coming from imperative programming styles, it might seem hard to lose the ability to specify more complex logical flow. That loss, though, is discipline leading toward the ability to create vastly more flexible systems, a first step toward the pattern matching model common to functional programming.'"

4 of 190 comments (clear)

  1. Re:!Like by BasilBrush · · Score: 4, Insightful

    CSS alongside 2 basic layers, regular code and HTML document itself, only creates additional unnecessary third layer of shit that eventually may introduce problems, as soon as someone starts playing with it

    That's like saying MVC is unnecessary, and not just putting all your code in a single class/module/namespace may introduce problems. There are people that say that, but they are novices.

    HTML5/CSS/JS is equivalent to MVC. The "VisualBasic" type people would tend towards trying to put everything in their HTML rather than the other way around.

  2. Re:Completely agree by itsdapead · · Score: 4, Insightful

    Anyone who has used JQuery will know how their power exceeds the original intention

    ...anybody who has used jQuery will know how powerful they could have been if only browsers had implemented them completely and consistently.

    Meanwhile, anybody who has used CSS will wonder what the hell the original intention was, given the arcane kludges needed to produce popular web-page layout effects easily achieved using evil tables and frames, the lack of 'constants' to set standard colours and measurements.You know there's something wrong with a standard when Microsoft's broken box-model implementation makes more sense. However, that's not the fault of the selectors.

    Its as if the designers* of CSS had never looked at a web site, used a DTP package, used styles in a WP package, let alone played with a Java layout manager to get ideas about what might work and/or be useful.

    (* probably unfair - I'm sure it was a mixture of committee syndrome and the notion that you can define a standard without producing a reference implementation rather than individual failings).

    --
    In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
  3. Re:Completely agree by dingen · · Score: 4, Insightful

    Things like SASS and LESS point out where the big flaws of CSS are. It's crazy we still don't have variables in 2013 by default, this has been at the top of the requested features list for what, 15 years now?

    --
    Pretty good is actually pretty bad.
  4. Re:Completely agree by RevDisk · · Score: 5, Insightful

    I always liked PHP, but I'm an infrastructure guy who only uses PHP for relatively minor stuff. Something doesn't need to be perfect to be useful.

    Please don't burn me, I don't weigh the same as a duck...