3 ms·
The difference is that with JavaScript, you can install a linter and happily restrict yourself to the sane subset of the language. It's very realistic to never
by leppr 8y ago
The difference is that with JavaScript, you can install a linter and happily restrict yourself to the sane subset of the language. It's very realistic to never have to deal with any of the uglier parts of JS, even as a full-time front-end developer.
With CSS, you can't avoid hacks. If you try to design anything non-trivial, you will have to employ tricky non-semantic tricks, run into edge cases, and have to settle on ugly, non-optimal solutions.
I don't think it's a declarative vs imperative thing. It's more that CSS was designed to be easy to use and relatively terse for a specific, outdated use case (20+ years ago when a website page was thought as a 1 dimensional flow of text and pictures).
Nowadays our requirements encompass pretty much the full spectrum of 2D space design, yet we still use a language that builds on high level primitives designed for a narrow usecase.
New features like Flexbox and CSS Grid help with the layout part, but it's not enough.
- BigJono 8y agoWhat does installing a linter have to do with using a subset of a language? Just... use the constructs you're familiar with? It's not like you can "accidentally" use an ES6 class or something.
- yakshaving_jgt 8y agoYou can accidentally use == instead of ===, or even accidentally use the assignment operator instead of one of the comparison operators. You can know about for..in without knowing about hasOwnProp. You can forget to enable strict mode. The list goes on. Static analysis is universally a good thing.
- deleted 8y ago[deleted]
- bryanrasmussen 8y agoinstalling a linter and limiting yourself to a subset of the language has to do with the fact that most development is done in teams, so when you limit yourself you limit the team to an agreed upon good subset of the language and nobody screws you over because they think the with statement needs a workout.
- perilunar 8y ago> 20+ years ago when a website page was thought as a 1 dimensional flow of text and pictures Here's the thing though — most websites are still just a '1 dimensional flow of text and pictures'. They try to disguise it with multiple columns of guff, but it's still just text and images. Sometimes a video. Sure there are web 'apps' now too, but most websites are not apps (thankfully).
- krapp 8y ago>Sure there are web 'apps' now too, but most websites are not apps (thankfully). The thing is, web apps are also just a more complex version of the same '1 dimensional flow of text and pictures,' just maybe with Canvas and a lot of javascript. There's no real difference between a web app and a document, as far as HTML/JS/CSS is concerned. The dirty secret of the whole "the web used to be documents but now it's applications" meme is that the applications are still documents.