[Rant] I'm happy about JavaScript's [hopeful] replacement, but I wish CSS was the one being replaced

I could rant about how insufficient it is all day, but I think this sums it up perfectly:

Since when is okay for the biggest joke of a language (term used lightly) to be it's sole purpose? Would we still use the C language today if sometimes 2 + 2 returned 5? I doubt it. Also, the fact that I have to use JavaScript to fix it is adding salt to the wounds. Not only does it break separation of concerns, but I just plain hate JavaScript.

Mind you, I'm reasonably new to web-development, as my primary focus is programming, not web-development1, but since when does putting align-whatever: center; not center!!! Instead, it's a game of hit-and-miss as to the correct placement of the bloody thing. Eventually I gave up and just used a <center> tag (shun me if you must, I understand).

I hate that CSS is a standard that must be supported, but I'm unconformable with people's lack of hate. I'm I alone in my war on CSS?

Sometime™ I should try out CCSS on my server. It looks to be a savior, but I'm a horrible procrastinator. And just for fun: what I wrote when a co-worker showed me FOAAS.

1We use bootstrap, which I hear has awful JS. Like not having semi-colons and such. Perhaps some of my poor experiences have been due to bootstrap, but when making something from scratch on my personal test server, it was quite hard just to get a footer to stick to the bottom. Why should it be this hard! Heck, why should it be so hard to center one element.
Also, sorry if this is really small text, but I didn't want it to be as large as the rest of my conversation, and making everything else part of a header was out of the question.

1 Like

I just want to point out that WebAssembly is not a "replacement" for JavaScript (if that's what you meant). It is a type of bytecode that browsers will (hopefully) agree on. Once it is supported, it will be possible to compile other high-level languages (maybe JavaScript as well) into WebAssembly. So, JavaScript isn't going to go away, you'll just get more options.

I did realize this, but thanks for the clarification. It's more the fact that is has the possibility of replacing it simply because browsers will support it instead of needing to just recompile into JS (except when it's not supported). Most CSS alternatives simply recompile into CSS. Not that this is necessarily a terrible thing, but it would be nice to see something that's supported by different browsers.

HTML5 = the structure, CSS = the look, Javascript = re-activeness.

I fully agree that CSS needs a replacement, or rather an alternative for backwards compliance. But when you compare CSS to others, like all that ugly XML in "normal" programming languages for defining layouts CSS is not all that bad.
I would argue trough that JS needs to be replaced before CSS - CSS can be rendered quickly and relatively cheaply, JS can not. More and more website are being viewed via phones and tablets and CPU time there is expensive battery-wise.

When I first started with web development I thought it was really frustrating. It wasn't pleasurable to work with, it was torture. But now a few years later I see why I thought so, and I disagree with you.

Compare starting with web design to when you're first starting with object orientation, at first you've got absolutely no idea what classes and static are, and why leaving out static all of sudden breaks the whole program. But once you grasp it everything becomes a lot more logical. The same with CSS. It has a set of rules/concepts that it builds its foundation on (for example elements are either block or inline, and that has consequences), then selectors are built on-top of that. Just imagine what a huge PIA it would be if these concepts weren't defined (eg an element which is inline takes up as much space as it needs and cannot be sized). One browser would let you set width on an inline element and the next wouldn't etc. It would be an absolute hell.

If someone sat down and broke down the concepts to you, before you jump into coding, things would make a ton more sense. You'd understand why "align: center" doesn't work in case A, but it works perfectly in case B. But sadly nobody does this, instead we're rushing to get in and write the code immediately, and end up with badly written code and angry developers. But as you work with CSS and gain experience you'll start to see the relationships between concepts and selectors.

But some additional features would be great, such as variables.

2 Likes

Yeah, I definitely feel like having a bit of an understanding of the core concepts would help. I work mostly with the back-end ASP.NET running it, and I just set up something that looks reasonable for our intranet, so needing to actually play with the CSS is often already because something isn't working.

Perhaps the reason that it's so hard to learn the core concepts is because you don't need to learn them like static in OOP. You can continue to struggle along without knowing anything like I am now. I still think, even if it works, CSS is completely unintuitive and should be replace, but maybe it's not as bad as I've thought it to be.

I've never had a proper course on CSS, and I think that partially where my hate comes in. I've never had as much trouble with other things, and everything I know up until now has been, for the majority, self-taught, some tutorials, a couple of really cool lectures from YouTube or light discussion with my co-worker. Hell, I was being paid to program a couple of years before I even went to college. And then this little wannabe language comes along and decides to show some difficulty. Something harder than pointers, assembly or multi-threading? No, I won't stand for that. I think my contempt for it not being an programming language has kept me from actually trying to learn it.

In the end I do have a decent respect for people that understand CSS, and I might look to see if there's anything good online to learn from. I still think we should let CSS burn, but again, maybe not as bad as I previously thought.

Good point. I have to say I would agree JS needs to go first for reasons you have mentioned. Doesn't mean I wouldn't like it to be another way, lol. As to XML, I sometimes prefer it just because it often comes with an editor, and you can use constraints of some kind, which is what I hope CCSS will be nice with (if I ever stop procrastinating and actually try it).

ah, css has been replaced -- you probably want the flexbox layout. most browsers support it now, except for pesky (old) ie!
it's easy to do layouts that have proper grow, centering, etc with flexbox

read more! all though almost all guides on flex box on the internet are awful.

2 Likes

Wendell saves the day ;)
Is it supported on mobile devices and webkit?

mobile devices have the best support for flexbox. you can do a "mobile app" style layout really, really easily and lightweight-ly with flexbox. So you can make fast responsive apps that work great even over our horrible 5kbps american "4g" networks.

1 Like

Wow, thanks. I'll check it out. Can't believe I haven't came across it before.