Live data from Hacker News

CSS is unnecessary given a layout language

pchiusano.github.io

101–110 of 183 posts

Re: CSS is unnecessary given a layout language

#101
post #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.

Seems to me that the answer is to provide a real applications development environment. Not to shoehorn ever more crap into browsers.

I've called before for splitting Web functionality into several modes. I think it's fairly clearly the way to go, and is actually how development's been headed to a reasonable approximation for the past few years.

1. A reading / discussion oriented platform. The traditional browser, though with vastly better document management capabilities, and much simpler graphical presentation. Basically elecronic paper, similar to Pocket / Readability / Instapaper, or an eBook reader.

2. An applications development platform. Pretty much where the mobile space is now. There's Internet connectivity, and often Web elements. But what you get are freestanding apps.

3. Commerce. It's own space for security and privacy as well as function. You're seeing this with iTunes, the Play marketplace, and Amazon commerce apps.

4. Multimedia. Give me a freestanding player with its own queuing mechanisms. Again, pretty much the case on mobile.

More: http://redd.it/256lxu

Re: CSS is unnecessary given a layout language

#102

CSS is broken. I've just been watching a colleague learning HTML/CSS for the first time. HTML was easy and she has a very good handle on that, producing some nice HTML5 markup by hand very quickly. CSS has been a nightmare - mostly not because of selectors or values (that comes later), but because of basic layout issues caused by the nasty hacky layout model of CSS - in particular the concepts of floats, block and in…

> But I disagree that CSS should thus become a general purpose programming language - the separation of concerns in HTML into content/style/controller is very useful and would be terrible to throw away, just because our current styling language is so lacking.

Separation of concerns or technology? For example if you use React.js you have view-controller, therefore why do I need CSS in an external file? I don't, it's there only because can't be into the React.js view. I would prefer to have the styles right in the view. The colors and this stuff might be per template basis which can be changed with js.

If they still want to continue with CSS they should really make some stuff like in javascript "use strict" which works a lot as expected. No more margin:0 auto to center no more of that unintuitive rules and specifications that varies so much.

Even responsive design only cares about window width, this is not enough to design a responsive website/app. Now are preparing something that is relative to a parent, which is even more useful, but not yet working.

This could be solved with a proper javascript layout engine: like qooxdoo for example which has layouts like in flex; I don't say this is a good or bad framework but for me was just to invasive and rigid. I come back to css+react.js but no html, I also don't thing that you should think of UI based on html terms but on component terms like react.js.

Still trying to solve this pain.

Re: CSS is unnecessary given a layout language

#104
Html used to have style embedded into it (blink, table, align, font etc).

The idea of separating the style into a css file was born in a time when server side scripts were generating the html (hence the programmers), and the frontenders didn't want to ask for code changes nor code themselves. So they figured that if you could separate the content from the style, they could make changes without talking to programmers.

This didn't always go so well. As you all know, css quite often require wrapping divs and other content tweaks to do its wonders.

Eventually the frontenders gave up and took over responsibility for all the markup, only requiring a CRUD backend.

So now we have separation for no apparent reason. Some argue that it's a great benefit to be able to swap styles by swapping csses, but how often is this really used? And having parallell structures in your code is a known to be costly developer-wise.

If I look at how Bootstrap tries to close that gap by fixing the style of different elements and factor in the fact that all frontenders know how to code and own all the markup I think to myself: why not go back to the old system?

Html5 has already started this trend by giving explicit names to tags instead of calling them "div", "span" or "object". Btw, why have div and span in the contents, the only difference between them is style, right?

I think it's time to consider html a rendering artifact and let style be embedded.

Re: CSS is unnecessary given a layout language

#105
post #51

Graphical layout is one of the most underestimated challenges in computer science. Programmers instinctively look at the problem and thing "oh, this is logical, I'll just whip up some basic principles and layout primitives and I'll have this solved in no time!" No, you won't. Designing a layout framework is really, really hard. Designing one that is simultaneously expressive enough to handle all of the crazy corner c…

Have you seen http://gridstylesheets.org/, which works as a polyfill and puts the Cassowary Constraint Solver behind CSS? It doesn't solve all CSS issues, but it's better than what I'm using today [1].

[1] Though I haven't used Flexbox in earnest yet.

Re: CSS is unnecessary given a layout language

#106

Earlier quoted context omitted.

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 und…

I have run successful companies and been fine without ever knowing basic accounting.

We are not talking about what is most important we are talking about what is most useful powerful for someone who today is in school and need to have some skills for the future.

Are you seriously telling me that if you had to choose for your kid you would tell them to learn accounting and not programming?

Re: CSS is unnecessary given a layout language

#107

Earlier quoted context omitted.

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.

Accounting HAS a language it is not a language a very limitied one.

You can't simulate the world in 3d with accounting, you can't create digital maps, program airplanes, music applications, steering and so on.

With programming you can simulate more or less anything you want even accounting software.

Re: CSS is unnecessary given a layout language

#108
post #83

Most "problems" with CSS (with the exception of vertical centering and a few others) are caused by the fact that people can't be bothered to learn CSS. It's funny: if a programmer is told to write CSS but doesn't know how, he'll copy-and-paste from Stack Overflow, get a shit result, and say that CSS sucks. If a programmer is told to write Elm but doesn't know how, he'll learn the language, write some decent Elm, and…

I've learnt many technologies over the years and I will no doubt learn many more. Your statements above don't consider the important question - the relative complexity of CSS compared to other aspects of web development. "You can't be bothered to learn your tools" isn't terribly helpful when you've just given someone a hammerwrenchbathplug.

Sorry for the OT, but, a hammer-wrench-bath-plug is a lot more fun to imagine than a hammer-wrench-bathplug

Re: CSS is unnecessary given a layout language

#109

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…

> "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"

FYI: this is incorrect. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Under...

Re: CSS is unnecessary given a layout language

#110

Earlier quoted context omitted.

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

> But, at this point, there is no abstraction gain from > ... > over floating_figure(...) There is no abstraction gain, because you are using a presentational class name. It should not be "floating_figure", "big_red_text" or anything of the kind. What it could probably be is "feynman_diagram" or something simmilar describing what's so special about this particular element, not the looks or placement of it. And then i…

Same difference. s/floating_figure/feynman_diagram/, and nothing about the story changes.
Post reply on HN