Live data from Hacker News

Grid Style Sheets – Replace CSS with a Constraint-Solver

gridstylesheets.org

61–70 of 99 posts

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#61
post #40

From their demo: structure.gss @h |-(#message)~-~(#follow)~-~(#following)-(#followers)-| in(#profile-card) gap($sgap) !strong { &[top] == &:next[top]; } } If you inject stuff like this into a project, make sure you're doing it solo. 'cause if you're on my team, i'll slap you. WTF is this voodoo? Less and Sass aren't complex enough? CSS isn't hard enough to work with as it is?

> 'cause if you're on my team, i'll slap you Because you're so macho, right? And anything you don't understand shouldn't be used. [EDIT] I find the sample code quite readable -- as long as one understands that it does more than constraints in that example, and that you of course have to read on the symbols to get them, like you'd have to read on Ruby's @, C's * and &, on regular expressions, etc. But this macho talk…

> Because you're so macho, right? And anything you don't understand shouldn't be used.

Or because he finds it so objectionable that he wanted to express strongly how much so it is. You read way too much into it.

> But this macho talk from "team leaders" I dislike.

Why do you assume he's only talking about situations where he'd be the team lead?

> That the leader is so arrogant that wont discuss but bully his team?

How about that other team members should consider the impact of technology choices and discuss them with the team before putting potentially controversial choices like this into use? (and no, not in order to avoid physical retribution, but because some choices are just awful).

> How about we reverse it: who would want to work in a team with some slap happy lead?

How about you don't read way too much into it? Most places I've worked, slapping someone would lead to a minimum a written warning, but more likely would get you fired, and it would not be impossible the victim would call the police to report the assault.

As a result, absent other information, it is quite reasonable to assume that the comment did not imply he would actually slap anyone.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#62
post #40

From their demo: structure.gss @h |-(#message)~-~(#follow)~-~(#following)-(#followers)-| in(#profile-card) gap($sgap) !strong { &[top] == &:next[top]; } } If you inject stuff like this into a project, make sure you're doing it solo. 'cause if you're on my team, i'll slap you. WTF is this voodoo? Less and Sass aren't complex enough? CSS isn't hard enough to work with as it is?

> 'cause if you're on my team, i'll slap you Because you're so macho, right? And anything you don't understand shouldn't be used. [EDIT] I find the sample code quite readable -- as long as one understands that it does more than constraints in that example, and that you of course have to read on the symbols to get them, like you'd have to read on Ruby's @, C's * and &, on regular expressions, etc. But this macho talk…

Way to overreact to some shallow taunting. You read a lot of things into this that aren't there.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#63

As GUI dev who worked with Apple's AutoLayout extensively I can confidently say constraint-based layout is a trap. It looks like more intuitive way to go on simple examples, but complexity spikes quickly as number of controls goes up. It's more complicated, more resilient to changes (harder to maintain), easy to get wrong, hard to understand and debug, bugs generally look uglier (what would be minor misplacement in C…

I saw the headline , didn't even read the article and came here to say this and saw your comment.

I've been struggling with auto-layout for about six months now. I finally get it but there's a certain impedance mismatch between how you want your elements to be laid out and what constraints are required to achieve the same result. Humans beings aren't wired to intuitively think like a constraint solver.

I'm not an experienced developer but my thinking on this issue is that the platform should provide some functionality to achieve the most common boiler-plate layouts and anything more complex should be written in code.

Usually constraints are simple and so are the layouts. But to achieve more complex layouts you need constraints which are at cross purposes to each other but have different priorities. It's not intuitive to work through this stuff.

Here's an example :

http://stackoverflow.com/questions/25766747/emulating-aspect...

The answer there is great but tell me , you could have aspect fitted the view to it's parent in just four lines of code instead of going through this confusing series of constraints.

I was making a tic tac toe game and I decided to try and draw the boxes and lines using auto layout. The constraints were making me tear my hair out and finally I wrote 5 lines of custom layout code and it took me only ten minutes and this was after futzing about with the constraints for half an hour and it did what I wanted to on an iPhone , iPad and for any height or width.

I personally believe in a simplified version of FlexBox for common cases (yes I think it needs to be even simpler) and custom code for anything more complex.

Bringing in all the baggage of a constraint solver to do your layout is like trying to use an Abrams Tank to kill a mouse.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#64

I'd love to use this. But in the back of my head I still think javascript should be optional if possible ... not that 99% of the rest of the world cares ...

"javascript should be optional"

As should CSS. From what I understand of GSS, it's entirely possible to use it to augment CSS rather than replace it. Granted, with certain layout problems it's trying to solve, that might be tricky/impossible.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#65
post #37

Earlier quoted context omitted.

> javascript should be optional if possible I got a blank page so I closed the tab. Any page that requires javascript and I don't need to use (at the level of do my taxes) or that I don't trust the owners of gets the same treatment. So yeah optional javascript is a thing unless 100% of your audience are absolutely required to use your site. EDIT given that sites today use google analytics instead of their own server…

You are a minority. Perhaps not here (HN) because "I disable Javascript" seems to be a pretty trendy thing to say (:P), but in the world at large you are. It's bad enough we have to build websites that work on IE8. We have to worry about screen readers and other accessibility problems, but we also have to worry about a fraction of users that disable a fundamental browser feature literally every site uses? Nah. It'll…

You don't really have to 'worry' about those things, you just follow best practices and - for the most part - they get dealt with automatically. Following the standards always gets you additional benefits that the "javascript required" crowd always gloss over. As a trivial example (there are many more), using a non-existent fragment identifier as a link target and capturing the click event doesn't just break when javascript is unavailable, it also breaks opening that link in a new tab.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#67
post #40

From their demo: structure.gss @h |-(#message)~-~(#follow)~-~(#following)-(#followers)-| in(#profile-card) gap($sgap) !strong { &[top] == &:next[top]; } } If you inject stuff like this into a project, make sure you're doing it solo. 'cause if you're on my team, i'll slap you. WTF is this voodoo? Less and Sass aren't complex enough? CSS isn't hard enough to work with as it is?

> 'cause if you're on my team, i'll slap you Because you're so macho, right? And anything you don't understand shouldn't be used. [EDIT] I find the sample code quite readable -- as long as one understands that it does more than constraints in that example, and that you of course have to read on the symbols to get them, like you'd have to read on Ruby's @, C's * and &, on regular expressions, etc. But this macho talk…

I thought personal attacks weren't allowed on HN?

EDIT: And apparently calling you out on it leads to immediate downvotes. Wow, this really is turning into reddit.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#69
post #20
post #2

None of the demos work correctly on safari iOS

Just tried a few demos on iPad 3 running iOS8, works fine for me.

Yes, because the iPad has a large screen. It doesn't work well on iPhone-sized screens.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#70

Earlier quoted context omitted.

> javascript should be optional if possible I got a blank page so I closed the tab. Any page that requires javascript and I don't need to use (at the level of do my taxes) or that I don't trust the owners of gets the same treatment. So yeah optional javascript is a thing unless 100% of your audience are absolutely required to use your site. EDIT given that sites today use google analytics instead of their own server…

Actually there is oftentimes a static "non js" tracking-image embedded within a -tag. Oftentimes this totally gets forgotten btw. And it is not only GA - it is Adobe Analytics, Heap, every conversion-tracker by Facebook and Adsense and the likes. SO yeah - we (so called) web analysts know that and even have ideas/means to track the number of people that disable js by default or that block every form of (browser based…

How would one block this?
Post reply on HN