Live data from Hacker News

CSS is powerful, you can do a lot of things without JS

github.com

291–300 of 319 posts

Re: CSS is powerful, you can do a lot of things without JS

#291
post #271

Earlier quoted context omitted.

Your complaint is essentially that they are using a language that other people working on the same project don't know. There are good reasons to discourage that: it fosters bikeshedding, and CSS's ways of expressing dynamic behavior doesn't match intuition as well as procedural javascript. However these reasons have to be weighed against technical limitations. Using CSS for dynamic behavior is often better than using…

Lets be honest, 99% of people who disable javascript are programmers who take great honor in complaining about every website that is more than 200k in size. This is a non-issue for most companies.

I started disabling javascript since every site these days includes a gazillion badly crafted scripts that take up too much cpu. It actually brings my laptop to a grind

(when having lots of tabs open)

Re: CSS is powerful, you can do a lot of things without JS

#292

Earlier quoted context omitted.

Was about to write the same. The three examples I clicked on - tabs, accordion, and menu - didn't work via keyboard. All of these are fairly simple show and hide interactions that are easier to use, build and maintain when done with javascript, with all the content shown if JS is turned off, not fully loaded or broken.

The accordion can work via keyboard with some styling changes, e.g. position or clip checkbox instead of display:none, add visual indication on :focus. I didn't check the others but their accessibility may be similarly correctible. Of course for accordion in particular it would be better if the pure HTML solution of using and elements was supported in all browsers. They're already in Chrome and Safari and will come o…

As one counter example: you'll never make a modal popup accessible without JavaScript. The focus management required is impossible with "CSS only".

Re: CSS is powerful, you can do a lot of things without JS

#293

Earlier quoted context omitted.

This is a-historical by my memory - the entire reason Gmail became so successful was that its use of "fancy ajax interactions" made it shockingly nicer to use than any of its competitors at the time. I think if one of your main selling points is interactivity afforded by javascript, then it is unlikely to have much return on investment to accommodate users who don't want that. But for sure people should be thinking h…

AJAX isn't why Gmail became successful. What set Gmail apart from its competitors was the huge amount of initial storage you got (1 GB for free at a time when Hotmail offered less than 10 MB for free), a higher maximum attachment size (25 MB compared to the webmail standard 10 MB), Google search, and conversation view. All of which, by the way, worked with the AJAX-free basic HTML view.

I had forgotten how big a change conversation view was compared to other webmail.

Also for what it's worth, I still use the Basic HTML view because I find it a better experience, so AJAX was definitely not the selling point for me. The 1GB thing was a huge factor though.

Re: CSS is powerful, you can do a lot of things without JS

#295

Earlier quoted context omitted.

So, are you saying that a bunch of guys with wire cutters and guns would be unstoppable? Simple scenario: 1. Cut all the power (grid connections A, B and C, disable generators) - nobody says no if you ask nicely and have a big gun 2. Watch the special teams struggle helplessly to hack into offline systems 3.PROFIT!!! Your assumption (that the network somehow runs on unicorn farts and that the need for boots-on-the-gr…

Not good at metaphorical sarcasm, eh? Special forces not using guns because they sometimes need hackers make as much sense as web developers not using CSS because they sometimes need Javascript-based layout.

I was responding to this: "Only a matter of time before guns will only really be useful in third world countries without electricity" (emphasis mine) - still convinced that "issue not relevant at my level of abstraction" is not the same as "nonexistent".

Re: CSS is powerful, you can do a lot of things without JS

#296
post #122

I've worked with people who did things like this. It's not fun for anyone else on the team to try and figure out why you're using specific pseudo selectors on tags in a child inside a sibling in some label to make an accordion that would take 3 lines in Javascript.

I think the real question is why are you making an accordion? They are ghastly UI components to navigate for the end user. I could see a few limited cases for them, but if someone says 'we will implement an accordion layout' at work, im jumping all over that screaming NOOOOOO.

Re: CSS is powerful, you can do a lot of things without JS

#297
post #112

Earlier quoted context omitted.

> Mozilla (including Firefox) had XUL, but nobody cared. Have you seen XUL? Here's an example, from https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tu... All that does is display a window with two buttons. You can imagine how hideous it could get when it got more complex. Now, imagine this alternative (I'm assuming that id & title are mandatory arguments, and that orient is optional, default to horizontal):…

I must be insane because I don't really see that much of a difference between the two examples you provided. I can read one just as well as the other.

The former has 46 words/348 characters; the latter 20 words/176 characters. That's more than twice the tokens, twice the disk space, twice the cognitive load.

Re: CSS is powerful, you can do a lot of things without JS

#298

Earlier quoted context omitted.

> They want sites that work quickly, are easy to understand, and work on mobile just as well as on a desktop. Not quite: users want to achieve specific tasks as quickly and easily as possible. Certainly "work quickly" and "work on mobile" are two huge pillars of that for many (probably the majority of) tasks, but for many applications you have to make significant trade-offs in functionality under the constraints of a…

And it's not clear to me that fixing a broken system is worth the time, when we have a working system standing by idly. I don't know of anyone who is asking for more interactiveness for most of the web, but I do know that non-js works, and works well. It may not be as "interactive", but I view that as a good thing. Of course, this is all in context of a typical webpage. There are exceptions to this.

> I don't know of anyone who is asking for more interactiveness for most of the web

I don't know of anyone, besides programmers, who doesn't like the current interactive-web-app web more than the decade-ago full-page-load web. They don't like ads and popups and things being slow either, but they love Gmail and AirBnB and Facebook and on and on. We should solve the problems without throwing away all the good stuff.

Re: CSS is powerful, you can do a lot of things without JS

#299

Earlier quoted context omitted.

> I don't know of anyone who is asking for more interactiveness for most of the web Hi, that's me. The reason is, quite simply, because this is not a good user experience: https://pbs.twimg.com/media/CmaP3JvUcAA8-5a.jpg:large The open web is my platform of choice, and the technology is finally there. Progressive Web Apps[1] offer the features of native but are instantly-available, without downloading or installing. S…

I don't see how that image proves your point. Shitty designs are shitty if they are in a web-app, or mobile-app. OK, fine. I'll concede devs want more interactiveness. I have yet to see evidence that users want more interactiveness. I think that points to the arrogance of devs "who totally know better than the user".

That's funny, I just replied to you arguing the opposite. People in tech are the only ones I ever hear complaining about rich web apps. YMMV I suppose!

Re: CSS is powerful, you can do a lot of things without JS

#300

Earlier quoted context omitted.

This is a-historical by my memory - the entire reason Gmail became so successful was that its use of "fancy ajax interactions" made it shockingly nicer to use than any of its competitors at the time. I think if one of your main selling points is interactivity afforded by javascript, then it is unlikely to have much return on investment to accommodate users who don't want that. But for sure people should be thinking h…

AJAX isn't why Gmail became successful. What set Gmail apart from its competitors was the huge amount of initial storage you got (1 GB for free at a time when Hotmail offered less than 10 MB for free), a higher maximum attachment size (25 MB compared to the webmail standard 10 MB), Google search, and conversation view. All of which, by the way, worked with the AJAX-free basic HTML view.

Well, I doubt either of us have statistics for what really drove its success (and if you do, I'll gladly cede the point), but anecdotally, I and a lot of my friends at the time switched to Gmail not because we needed more storage (I don't remember even thinking about that as a problem with Hotmail at all) but because the interface was way better. If anything, I think it had more to do with the "cool" factor of getting an invite and the cachet of Google at the time than with the storage. But I freely admit this just personal experience talking.
Post reply on HN