Live data from Hacker News

CSS is unnecessary given a layout language

pchiusano.github.io

31–40 of 183 posts

Re: CSS is unnecessary given a layout language

#31
post #17

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.

Suppose you want to create the largest possible square div inside the rectangle of another div. Any layout language that can't let me satisfy such a simple and obvious layout constraint is a travesty. CSS will not let you do this, even with flexbox.

GSS will though! http://gridstylesheets.org/

Re: CSS is unnecessary given a layout language

#32
post #29
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…

LaTeX separation of style from content is in-principle even looser than HTML vs CSS. TeX doesn't enforce the separation at all, and lots of old style TeX documents mix it with abandon. But the culture of LaTeX users embraces the separation.

Right, I had not meant to imply otherwise. It was an example where there is nothing forcing you to separate style from document. At least, not to my knowledge.

Except, of course, for any paper you want to offer to get published somewhere that has a style file for you to use. Then, yes, you have to support that. :)

Re: CSS is unnecessary given a layout language

#33
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 abstractions and nothing stops you from providing different implementations for different situations, and these implementations can again use abstractions to deal with a variety of output devices. Nothing here requires you to define layout specifics as part of the document [1].

Moreover, not all the world is just plain sequential text. There are mathematical formulas and syntax diagrams, for example. math.stackexchange.com falls back to Javascript (via MathJax) in order to display formulas; and Lout provides an excellent example of how one can specify the spatial relationships of syntax diagrams [2] while still abstracting over the implementation details (Lout is another functional layout/typesetting language).

[1] Of course, in practice, the world is never so clean, and you can rarely ignore layout constraints entirely; anyone who has ever written a paper containing a non-trivial mathematical formula knows that.

[2] http://i.imgur.com/huD07xc.png

Re: CSS is unnecessary given a layout language

#34
I don't think the problem is that CSS is an unnecessary approach to the problem of layout. It is more that it is a poor approach to the problem of layout.

A layout language is unnecessary given a bytcode VM a chunk of memory, code, and an output. The balance is in capability, performance, and understanding.

I have done a lot of CSS wrangling which has given me plenty of time to consider what 'a better way' could be. I doubt I'm alone in that respect.

CSS has three parts. Properties, selectors, and values. When someone is talking about how awesome CSS is they have usually done something clever with selectors. When someone is ranting about getting CSS to work right, they are usually trying to figure out what set of values to put into properties.

The properties themselves are insane. The legacy of incremental development and serving many masters. The options for values are limited. attr() would help my own usage a great deal but Firefox doesn't support it (see here someone complaining in 2011 that they've fallen behind Internet Explorer on this https://bugzilla.mozilla.org/show_bug.cgi?id=435426#c3).

Actually Properties, values and Selectors are all limited. Selectors are just the least weakest link. Properties could do with a complete breaking overhall (ie. If a document is in doubleplusgoodCSS mode it only supports the new style properties). property values should be the results of expressions in a pure functional language. Selectors should be another expression system with operators and member-check functions, the selector system is close to what it needs to be already. Just a mechanism for user defined groupings (such as attributeContainsPrimeNumberAsHex("class")) and combinators.

Re: CSS is unnecessary given a layout language

#35
post #18

Earlier quoted context omitted.

What about accounting? Most professionals need a basic grasp of accounting.

Accounting is not a language, programming is. You can create anything with programming. Thats why it should be taught. Edit: Care to elaborate why that comment should be downvoted?

Accounting is actually a language. It's the language of finance. You're probably confusing accounting with finance.

Re: CSS is unnecessary given a layout language

#36
post #27
post #17

Earlier quoted context omitted.

Suppose you want to create the largest possible square div inside the rectangle of another div. Any layout language that can't let me satisfy such a simple and obvious layout constraint is a travesty. CSS will not let you do this, even with flexbox.

Has anyone assembled a list of things such as this that CSS cannot do? FlexBox always felt like it was a direct response to a few specific cases rather than a generalized gain in flexibility.

I'm pretty sure FlexBox solves the "Why the hell can't I center these things vertically relative to one another?!?" problem that CSS has had for a very long time. Unfortunately, that wasn't the only problem CSS has had. Now we have to wait for CSS Grids, which look awesome and all, but based on history (floats, positioning, inline-blocks, flexbox) I'm not getting my hopes up that Grids will finally make CSS layouts reasonably adequate. (I'm not even raising the bar to 'usable'.)

Re: CSS is unnecessary given a layout language

#37
post #17

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.

Suppose you want to create the largest possible square div inside the rectangle of another div. Any layout language that can't let me satisfy such a simple and obvious layout constraint is a travesty. CSS will not let you do this, even with flexbox.

Huh? Flexbox will certainly let you do this: http://plnkr.co/edit/taXhuM4tetbNTlaKyjDr?p=preview (you shouldn't see any of the red box, just the green box)

Am I misinterpreting what you mean?

Re: CSS is unnecessary given a layout language

#38
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 displaying three or >3 dimensional information on a manifold. I am confident I could layout anything anyone threw at me, and CSS is just something I've picked up over the years.

Re: CSS is unnecessary given a layout language

#39
post #18

Earlier quoted context omitted.

What about accounting? Most professionals need a basic grasp of accounting.

Accounting is not a language, programming is. You can create anything with programming. Thats why it should be taught. Edit: Care to elaborate why that comment should be downvoted?

I think you're being downvoted because life isn't just about creating something. Basic accounting is an important tool for any adult living in this world. I would argue the knowledge of managing finances is more important than programming, because it applies to everyone, regardless of your career path.

Debt, loans, mortgages, interest, investments, retirement plans, etc. These are important things for everyone to understand. When I look around, I think a lot of people would be better off if they had a better understanding of finances, but I rarely look at people and think their lack of programming know-how is holding them back.

Re: CSS is unnecessary given a layout language

#40
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…

[deleted]
Post reply on HN