Live data from Hacker News

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

github.com

201–210 of 319 posts

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

#201
post #26

History is going to look back at CSS in disbelief when it calculates the amount of engineering time was spent trying to position elements correctly. This isn't hating on CSS as much as how broken layout creation is with no end in sight--but plenty of hacks.

What do you mean? It's quite easy to position elements on the page however you please. It can get quite complicated if you wish to support multiple viewport sizes with dynamic resizing, but it can be done.

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

#202

Earlier quoted context omitted.

Days of the old web where flash was pervasive and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere. Every generation of the web has had really crappy devs building bad experiences. The current generation is not making anything worse than it's predecessor.

My current-favorite problem with modern web development is mobile-specific redirection. e.g. you click a link in your email and it takes you to "www.foo.com/somethingWithParametersAndImportantStuff", foo.com detects you're on a phone and redirects you to their mobile homepage at "m.foo.com", blowing away your URL or even better not supporting your particular URL's page in the mobile site... where... your mobile brows…

http://xkcd.com/869/

Anyone know where I can find publication dates for individual comics? I don't see anything on the comic's page.

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

#204
post #112

Earlier quoted context omitted.

Mozilla (including Firefox) had XUL, but nobody cared.

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

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

#205

Earlier quoted context omitted.

"best viewed in Chrome" is getting annoyingly common.

Bank Of America recently told me it only supported Safari and Chrome on MacOS... But... supported Firefox on Windows. Whaaaa....

"Support" means they are on the hook if something is broken. Every OS/browser combination is a cost center and potential liability.

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

#206

Earlier quoted context omitted.

Days of the old web where flash was pervasive and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere. Every generation of the web has had really crappy devs building bad experiences. The current generation is not making anything worse than it's predecessor.

>... is not making anything worse... That's a pretty low bar.

Maybe, but it's an accurate assessment to someone pining for the "old days"...

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

#207

Earlier quoted context omitted.

I'm reminded of the Jurassic Park quote when I see people doing "neat" complicated CSS hacks to do stuff a line of JS would do... "Yeah, yeah, but your scientists were so preoccupied with whether or not they could that they didn't stop to think if they should."

For some reason I hear that in my head in Jeff Goldblum's voice

Probably because he said it.

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

#208
post #194

Earlier quoted context omitted.

I'm interested in seeing these 3 lines of Javascript that can implement an accordion. With a sane limit to number of characters on each line as well.

With jQuery it's probably like 4 or 5 lines. With plain JS a few more as you have to write your own iterator function. All an accordion does is add an event listener that removes a class from all elements and adds it back to one of them. Then there's a 1 line transition for that class in css.

Is jQuery included in those 4 or 5 lines? One line of CSS in your accordion?

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

#209
post #172

Earlier quoted context omitted.

Days of the old web where flash was pervasive and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere. Every generation of the web has had really crappy devs building bad experiences. The current generation is not making anything worse than it's predecessor.

Well, "your browser is unsupported" is something I still live with. And on the other hand, if I don't have the setup the developer expects, things just quietly break with nothing to tell me what's up. How is that better? Flash never really was a problem for me; very very few used it for anything critical. It was mostly for entertainment and media that has no value for me. I lived just fine with no flash installed, an…

"Flash never really was a problem for me; very very few used it for anything critical."

Actually there was a period (end of the 90s, early 2000s) where flash was pervasively used to build entire sites. They were worse than single pages app of today. Completely broke browser history, urls etc... Those are similar complaints to today but now that APIs and workaround exit, it's mostly laziness that prevent people from properly building apps that avoid these pitfalls.

"And frankly the "best viewed in whatever" websites weren't a problem either".

There were days where not having a windows machine with IE installed meant not being able to bank online, access university course website etc... This is no longer an issue that I run into much in 2016.

"Living with JS (and other obnoxious features) disabled, on the other hand, has gotten really fucking difficult now."

That used to be the case too with Flash (and java to a smaller extent). Without flash many many sites were completely broken. This obviously got better with time to the point where it's hard to remember but it was pretty horrible to try to use the web without flash circa 2000-2006 or so.

I get that some want JS disabled but it's the only cross browser method of achieving certain interactive experiences on the web. It's not new technology and has been around since the earliest days of the web. The percentage of people with JS disabled is so low (less than 1% in sites on many sites I've dealt with) that it was very hard to justify the added effort to support both (in the case of the sites I worked on, they were large enough that the effort was made). As the web becomes used for more and more use cases, it's going to be hard to keep accommodating a very small minority of users. If JS wasn't there, something else would have to exist to do what it does.

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

#210

Earlier quoted context omitted.

My reasoning is that CSS is not a language, it's just a configuration file. It doesn't have a console.log, but it has `background: red`. JS as a language and as such ( especially it's callback / event-driven nature ) makes it harder to debug.

Yes, but with the browser debugger you can step through the JS code and visualize what it is doing. How can you visualize what is happening with CSS, short of debugging the internal browser code ?

select an element and see which rules are active on it?
Post reply on HN