Live data from Hacker News

CSS is unnecessary given a layout language

pchiusano.github.io

41–50 of 183 posts

Re: CSS is unnecessary given a layout language

#41

Does anyone think it'd be a good idea for browsers to support more than one toolset? Right now it's just HTML+CSS+JS, no matter what languages people build on top of that assembly. Elm seems like a neat idea, but based on Paul's post, I dislike the fact that it compiles down to CSS. It seems a disingenuous way to present the language. I'd much rather a browser was simply told this was an application/elm or something…

Arguably the removal of XLST/XML from the stack of tools browsers support(ed) in favour of JSON/JavaScript (or Anything-including-XML/JavaScript) is a good thing.

I still think there are some good ideas in XML/XLST/SAX/XSD/RELAX NG -- but I think it's clear by now that web developers will not, or cannot, leverage the (rather minor) benefits XML can offer over json/javascript (richer datatypes, mostly -- javascript has gotten so fast that I don't think there's any real benefit to xml+sax over JSON in terms of memory/performance -- so once you throw away all your xml tools as well, there are little benefit remaining).

Generally you can implement pretty much anything else on top of javascript. I do think we could use a better/different rendering model -- having documents/HTML as the base isn't a very good idea. Not sure what the answer would/should be -- seeing how Apple abandoned display postscript, I don't think PDF is the way to go -- perhaps something closer to GL?

I'm a bit of a 90s luddite when it comes to "shiny web apps leveraging javascript for max bling" -- I much prefer gracefully-degrading html+css apps slightly augmented with javascript. But for better or worse, the immediate future clearly belongs to "download code over the internet;run it". Currently we're stuck with js+http+dom as the only real write-once-tweak-for-ever-run-most-places alternative. I think short time success will go to frameorsk like Elm and clojurescript that compile-to-the-browser.

And at the rate of progress we seem to have, I don't think we'll see great platform for delivering apps/objects/runable data in the near future. We appear likely to move the visual basic worms of the 90s to javascript worms of the 10s -- never gaining any decent security or privacy -- because there is no demand for it.

Luckily, well-designed "apps" based on html+css+conserative js can still be great, and have great performance, so I'll try and stick with that, and I'll let everyone else continue to design blogs that can't be read without running "actual" code on the client. For no real benefit (to the user -- to those selling ads/behavioural data the benefits are more tangible, but I'm not a user of that -- I'm just a victim of that).

/rant.

Re: CSS is unnecessary given a layout language

#42
post #21

I'm not really sure I understand what the point of this message is. The point of separation between CSS and HTML is not that "designers" are idiots. Nor is it that developers are poor designers. The idea is strictly to keep the data separate from any other concern. This is broken all of the time by all sorts of grid based elements and such. But the idea does seem decent, if a touch naive. That is, to Spolsky's credit…

> That is, to Spolsky's credit, the point of HTML being completely layout free is supposed to be the compelling feature. Except that it isn't. If you want to do anything entirely non-trivial, you have to annotate your HTML with classes and ids, and then hook into this using a complicated declarative language. But, at this point, there is no abstraction gain from ... over floating_figure(...) Functions are fine abstra…

I said that was the point. Not that it succeeded at it. I fully acknowledge that it is broken all the time. However, if you want a loose control over the visual characteristics of a paragraph with some images, than the base html and css for floats gets the job done. Want columns? Yeah, you're screwed.

Seriously, most of the headaches from css come from trying to get it to do things that were not goals for the designers of the language. This is not a bad thing. But to believe that a turing complete language would have been a panacea is dangerous. And likely wrong.

Re: CSS is unnecessary given a layout language

#44

I actually like CSS as it is now, and it's getting better ( cough , flexbox). Am I the only one who finds CSS incredibly hard to master, though? I've been writing CSS for years and I still feel like a newbie sometimes, and feel like I'm just tinkering with random attributes until it looks right.

I don't mean to be rude[0], but what do you find so difficult about it? The box model makes a lot of sense, and once you understand that you're most of the way there. I still Google for less-common syntax (e.g. adding a strikethrough style to text) from time to time, but most of it is internalized by now[1]. Code School[2] was great when I was first ramping up as a developer.

I do also have a great memory[4] for tiny, usually-trivial bits of data like: "no matter the z-index of an element, it cannot overlap an absolutely positioned element (with z-index greater than 0) unless it is also absolutely positioned". It doesn't feel like it's any different than remembering various bits of syntax or APIs, but maybe that's a more difficult thing for some people to remember than others - IANAN[3].

Give Code School a shot (go through the whole CSS Cross-Country course). You can get a 2-day free trial here: https://www.codeschool.com/hall_passes/213f3fedb6b9/claim_sh....

[0] I actually started writing this comment ~15 times before settling on an opening.

[1] It's mostly just abbreviations now: I don't think or speak (or type) "background-color", I just think "bgc". This is due to the fantastic Emmet plugin for Sublime: http://docs.emmet.io/css-abbreviations/

[2] https://www.codeschool.com/

[2a] You might be specifically interested in https://www.codeschool.com/courses/css-cross-country

[2b] I also have an affiliate link if you're feeling generous: http://mbsy.co/7djLz

[3] I am not a neurologist

[4] Terrible short-term memory though - my wife constantly complains about how I can remember "all those coding things" but can't recall what she asked me to do <30 seconds ago.

Re: CSS is unnecessary given a layout language

#45

Does anyone think it'd be a good idea for browsers to support more than one toolset? Right now it's just HTML+CSS+JS, no matter what languages people build on top of that assembly. Elm seems like a neat idea, but based on Paul's post, I dislike the fact that it compiles down to CSS. It seems a disingenuous way to present the language. I'd much rather a browser was simply told this was an application/elm or something…

Function calls and loops seem like a neat idea, but I dislike the fact they they compile down to JMP. It seems disingenuous. I'd much rather the CPU just be told this was a loop and ran with that properly.

Re: CSS is unnecessary given a layout language

#46
post #21

I'm not really sure I understand what the point of this message is. The point of separation between CSS and HTML is not that "designers" are idiots. Nor is it that developers are poor designers. The idea is strictly to keep the data separate from any other concern. This is broken all of the time by all sorts of grid based elements and such. But the idea does seem decent, if a touch naive. That is, to Spolsky's credit…

If HTML was still just hypertext, which is text organized with links to other text, then the separation of data from appearance makes sense. But we happen to use HTML and other web technologies to create complex long-lived applications that are much more than hypertext.

Re: CSS is unnecessary given a layout language

#48

I like Mr. Victor a lot but I'm not sure I agree. I think the way CSS is implemented either doesn't jive with the paradigms many programmers use to approach problems or perhaps it is just laziness? I meet a lot of programmers who are generally pretty smart and capable completely throw up their hands when it comes to laying out HTML via CSS. It's just rectangles being displayed on rectangles. It's nothing complex like…

I'm with you - I've never understood the confusion about CSS. There are some more complicated tasks than would initially, appear, but once you grok the box model (and it's not hard) then it's pretty easy - and just use a framework for your column layout, no point in trying to reinvent Bootstrap/Foundation/[literally tens of grid frameworks]. Anything else you can't figure out, Google it.

Re: CSS is unnecessary given a layout language

#49
post #21

I'm not really sure I understand what the point of this message is. The point of separation between CSS and HTML is not that "designers" are idiots. Nor is it that developers are poor designers. The idea is strictly to keep the data separate from any other concern. This is broken all of the time by all sorts of grid based elements and such. But the idea does seem decent, if a touch naive. That is, to Spolsky's credit…

> That is, to Spolsky's credit, the point of HTML being completely layout free is supposed to be the compelling feature. Except that it isn't. If you want to do anything entirely non-trivial, you have to annotate your HTML with classes and ids, and then hook into this using a complicated declarative language. But, at this point, there is no abstraction gain from ... over floating_figure(...) Functions are fine abstra…

Yes. That's why the IMG tag was added. Everything we have now is an outgrowth of wanting to wrap text around that IMG tag.
Post reply on HN