News for hackers. Stuff that matters.
Re:CSS is powerful, you can do a lot of things without JS by achairapart on Tuesday July 05, 2016 @05:51AM (#12035371)
Most of these are just clever CSS hacks. There is a website collecting these kind of experiments since the early '00: http://www.cssplay.co.uk/

There was a time when separation of concerns and the "Rule of Least Power"[0] where the foundation principles of web development.

Today you have preprocessors, postprocessors, transpilers, content and style in JavaScript, behavior in CSS. Very powerful tools that can easily lead to unnecessary complexity.

On the other hand, somehow W3C failed to turn these principles into a truly interoperable and semantic web.

Ah! Also, nobody cares about unobtrusive JavaScript anymore.

[0]: https://www.w3.org/2001/tag/doc/leastPower.html

Re:CSS is powerful, you can do a lot of things without JS by cptskippy on Tuesday July 05, 2016 @09:57AM (#12036437)
> Ah! Also, nobody cares about unobtrusive JavaScript anymore.

I do. I also care about graceful degradation. There are certain times (e.g. Web Apps like Gmail) where graceful degradation is almost impossible and unobtrusive JavaScript would be silly but those are the exception. Most sites on the web are just content and there's no reason to have excessive JavaScript or any reason why the page can't be perfectly functional without it.

Re:CSS is powerful, you can do a lot of things without JS by jhall1468 on Tuesday July 05, 2016 @10:28AM (#12036634)
Just because something can be done a certain way doesn't mean it should be done a certain way. Minimizing javascript for the sake of minimizing it is silly.

People that disable javascript represent a tiny percentage of the population. No one is going to make engineering decisions based on that tiny percentage, anymore than people still target IE6.

Re:CSS is powerful, you can do a lot of things without JS by cptskippy on Tuesday July 05, 2016 @01:22PM (#12038021)
I'm not talking about minimizing for the sake of minimizing. I'm talking about not using JavaScript for the sake of JavaScript. Or better, not using JavaScript because you can't be bothered to understand what your problem is or how to avoid it.

- Page content doesn't need to be side-loaded in AJAX.

- Site layouts don't need to be set in JavaScript at page load. Animated menus don't need to be done in JavaScript and neither do pinned toolbars, doing so usually causes issues and stuttering when scrolling because you have a script running every pixel shift.

- Every link on the page doesn't need to be a JavaScript function, it makes bookmarking or opening in a new window difficult to impossible to what benefit?

- If you do want something to open in a new window, you also do not need JavaScript.

- User controls don't need to be JavaScript and when they are, they usually fail to work in mobile.

- Popover slideshow galleries don't need JavaScript to manage page reflow. Most shopping sites do this for their product images and it completely falls apart on Mobile when you pinch-zoom.

Far to often I find myself on pages that are unresponsive (not referring to Responsive Design) because they're so laden with JavaScript that everything comes to a screeching halt. Or worse still, some syntax error in one script brings the whole page down or one script reference doesn't load and the page is completely unusable.

Re:CSS is powerful, you can do a lot of things without JS by ForHackernews on Tuesday July 05, 2016 @11:49AM (#12037209)
Yeah, who cares about people using screen readers! Or search engines...
Re:CSS is powerful, you can do a lot of things without JS by depr on Tuesday July 05, 2016 @12:22PM (#12037545)
Google executes Javascript, and

>It is a common misconception that people with disabilities don't have or 'do' JavaScript, and thus, that it's acceptable to have inaccessible scripted interfaces, so long as it is accessible with JavaScript disabled. A 2012 survey by WebAIM of screen reader users found that 98.6% of respondents had JavaScript enabled.

http://webaim.org/techniques/javascript/

Re:CSS is powerful, you can do a lot of things without JS by the_gastropod on Tuesday July 05, 2016 @10:14AM (#12036545)
I often hear rationalizations about how x couldn't be built with graceful degradation in mind. There certainly are _some_ examples (games, for example). But GMail doesn't strike me as a particularly compelling example. GMail is also _just content_. The fancy ajax interactions, though nice, are hardly required for an email client.
Re:CSS is powerful, you can do a lot of things without JS by sanderjd on Tuesday July 05, 2016 @10:24AM (#12036601)
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 harder about what their selling points really are - the market for "it's better because of ajax!" is probably tapped out.

Re:CSS is powerful, you can do a lot of things without JS by FroshKiller on Tuesday July 05, 2016 @12:52PM (#12037778)
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.
Re:CSS is powerful, you can do a lot of things without JS by sanderjd on Tuesday July 05, 2016 @08:04PM (#12040385)
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.
Re:CSS is powerful, you can do a lot of things without JS by CaptSpify on Tuesday July 05, 2016 @04:03PM (#12039119)
Also the spam filtering was years ahead of it's time
Re:CSS is powerful, you can do a lot of things without JS by qu4z-2 on Tuesday July 05, 2016 @06:12PM (#12039893)
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 by cptskippy on Tuesday July 05, 2016 @08:07PM (#12040394)
For me, the basic view has always felt neglected and kind of halfassed. The full experience has fully styled UI elements where as the basic view just defaults to the browser defaults. Outlook does this too.

To me it just feels like basic view is just v1.0 from 2004.

Re:CSS is powerful, you can do a lot of things without JS by qu4z-2 on Sunday July 10, 2016 @10:00PM (#12068384)
It's definitely the uglier of the two views, no question. I prefer it functionality-wise though. It does less of its own window management, etc.
Re:CSS is powerful, you can do a lot of things without JS by afarrell on Tuesday July 05, 2016 @10:16AM (#12036555)
I think doing what they do, having a less-fancy separate client, is less complex.
Re:CSS is powerful, you can do a lot of things without JS by adrusi on Tuesday July 05, 2016 @03:18PM (#12038820)
The semantic web failed in large part because browsers didn't implement XSL, and so the average web developer never learned about the idea of sending structured data to the client as XML and using XSLT to instruct browsers to render the data as XHTML. If these specs hadn't been released in the middle of Internet-Explorer-monopoly-induced-browser-stagnation then they wouldn't have been dismissed as failures by the time browser competition increased and standards started to be honored.

I'm not sure that the semantic web would succeed even if it were a new idea today. HTML5 was popular because it gave web developers tons of shiny toys and got them excited to use it. XHTML was conceptually beautiful but it hardly enabled any user-visible improvements over HTML4, so only the philosophically-minded web developers gave a fuck.

Re:CSS is powerful, you can do a lot of things without JS by harryf on Tuesday July 05, 2016 @07:26AM (#12035651)
Hmmm...

    .accordion .content {
        padding:0 10px;
        overflow:hidden;
        border:1px solid #fff;
        -webkit-transition: all .5s ease-out;
        -moz-transition: all .5s ease-out;
    }
-webkit-transition, -moz-transition... it's like we're at 180 degrees to where the web was in the days of IE4-6
Re:CSS is powerful, you can do a lot of things without JS by clarry on Tuesday July 05, 2016 @08:08AM (#12035817)
Remember when Good Developers would hate on framesets because they break the back button and linking and everything?

Now it's totally OK to break all that with AJAX and "text-as-apps"... I much prefer the days of the old web.

Re:CSS is powerful, you can do a lot of things without JS by nkassis on Tuesday July 05, 2016 @08:50AM (#12036006)
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.
Re:CSS is powerful, you can do a lot of things without JS by inanutshellus on Tuesday July 05, 2016 @10:02AM (#12036464)
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 browser could've just rendered the original site, albeit pinched.

It comes to mind because I'm currently dealing with this as an issue with UPS.com. We're halfway to 2017, people! How can we be having these problems.... :-)

Re:CSS is powerful, you can do a lot of things without JS by jdmichal on Tuesday July 05, 2016 @10:57AM (#12036855)
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 by WorldMaker on Tuesday July 05, 2016 @11:14AM (#12036984)
For questions like that I tend to jump over to the Explain XKCD wiki.

This comic was March 7, 2011.

http://www.explainxkcd.com/wiki/index.php/869:_Server_Attent...

Re:CSS is powerful, you can do a lot of things without JS by nandhp on Tuesday July 05, 2016 @12:28PM (#12037601)
The archive page -- http://xkcd.com/archive/ -- has each comic listed by title, with the publication date in the hover text. Server Attention Span was published 2011-3-7.
Re:CSS is powerful, you can do a lot of things without JS by jdmichal on Tuesday July 05, 2016 @01:12PM (#12037941)
Ah, I found the archive page but didn't think to check the hover text there... Thanks.
Re:CSS is powerful, you can do a lot of things without JS by marcosdumay on Tuesday July 05, 2016 @02:06PM (#12038295)
It's hard to search on that forum!

http://forums.xkcd.com/viewtopic.php?f=7&t=69169&hilit=serve...

It's from some time around Mar 07, 2011.

Re:CSS is powerful, you can do a lot of things without JS by JoeAltmaier on Tuesday July 05, 2016 @10:06AM (#12036492)
Digression: 'clicking on a link' may become an obscure reference soon, like dialing a phone. How many young people ever use a mouse?
Re:CSS is powerful, you can do a lot of things without JS by sanderjd on Tuesday July 05, 2016 @10:28AM (#12036631)
I'm very curious about this: is there a hypothesis that non-mobile computers are going away in the business world and/or that "young people" will not be involved in that world? I don't know the stats - are tablets making big inroads in business computing?
Re:CSS is powerful, you can do a lot of things without JS by WorldMaker on Tuesday July 05, 2016 @11:27AM (#12037065)
Humans have several millennia of evolution "touching things" for tactile feedback. Mice on the other hand are a relative (and quite useful) hack compared to that. It requires training and a different mental dimensional model to use. To a child growing up with modern touch screens, a screen without touch is the aberration and "broken". Mice may not disappear entirely, but certainly more and more screens in our lives will support touch interactions, even on desktops and "non-mobile computers", simply because it requires less training and feels more natural ("touch the button" versus "move the mouse to the button and click" may not seem that different after decades of mouse usage, but are very different experiences to an untrained person). There's a sense already today that kids growing up with tablets find mice strange and annoying ("Why can't I just touch that?"), and it's easy to wonder watching today's kids if mice will last for more than a footnote in history and in increasingly small niches that require "headshot precision" like games and maybe CAD.
Re:CSS is powerful, you can do a lot of things without JS by JoeAltmaier on Tuesday July 05, 2016 @10:33AM (#12036674)
Dunno. But my niece and nephew are tablet/phone experts, and have never used a mouse. And they are 4 and 6.
Re:CSS is powerful, you can do a lot of things without JS by MichaelBurge on Tuesday July 05, 2016 @11:25AM (#12037050)
If it comforts you, I used an upside-down SNES gamepad for a few years before ever touching a mouse. And today I use my mouse far more than any game controllers.
Re:CSS is powerful, you can do a lot of things without JS by mitchty on Tuesday July 05, 2016 @12:17PM (#12037499)
I'm more curious why it was upside down.
Re:CSS is powerful, you can do a lot of things without JS by MichaelBurge on Tuesday July 05, 2016 @12:39PM (#12037677)
I just grabbed one and starting using it upside-down. By the time anyone told me it was wrong, it already felt more natural to use it that way.
Re:CSS is powerful, you can do a lot of things without JS by clarry on Tuesday July 05, 2016 @10:46AM (#12036769)
I think that just means new computing devices have expanded the market, not replaced old devices. Some functionality that was once used exclusively on PCs (what else did you have?) may now be more commonly accessed via mobile devices. You didn't have a PC in your pocket when you needed to look up directions on a map..
Re:CSS is powerful, you can do a lot of things without JS by ZanyProgrammer on Tuesday July 05, 2016 @10:15AM (#12036549)
Any young person ( please define) who has ever used a desktop computer?
Re:CSS is powerful, you can do a lot of things without JS by clarry on Tuesday July 05, 2016 @10:33AM (#12036672)
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, and got performance & security benefits for simply not having it. Living with JS (and other obnoxious features) disabled, on the other hand, has gotten really fucking difficult now.

And frankly the "best viewed in whatever" websites weren't a problem either. On one hand it was mostly fanboyism. On the other, web designers using some niche feature that had no real impact on functionality or my ability to read & navigate the content. Again, I don't recall ever having to switch to another browser because of that. So it really was better for me back in the day.

Re:CSS is powerful, you can do a lot of things without JS by nkassis on Tuesday July 05, 2016 @11:06AM (#12036920)
"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 by TorKlingberg on Tuesday July 05, 2016 @09:57AM (#12036440)
"best viewed in Chrome" is getting annoyingly common.
Re:CSS is powerful, you can do a lot of things without JS by inanutshellus on Tuesday July 05, 2016 @10:03AM (#12036468)
Bank Of America recently told me it only supported Safari and Chrome on MacOS... But... supported Firefox on Windows. Whaaaa....
Re:CSS is powerful, you can do a lot of things without JS by jdmichal on Tuesday July 05, 2016 @11:01AM (#12036885)
"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 by clarry on Tuesday July 05, 2016 @10:33AM (#12036675)
And my bank keeps constantly nagging me that my browser (Firefox LTS) is no longer supported and that I must update immediately.
Re:CSS is powerful, you can do a lot of things without JS by nommm-nommm on Tuesday July 05, 2016 @11:37AM (#12037137)
I called my bank because I couldn't log in

"We recommend Internet Explorer."

Re:CSS is powerful, you can do a lot of things without JS by JustSomeNobody on Tuesday July 05, 2016 @08:59AM (#12036059)
>... is not making anything worse...

That's a pretty low bar.

Re:CSS is powerful, you can do a lot of things without JS by jdmichal on Tuesday July 05, 2016 @11:02AM (#12036892)
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 by otabdeveloper1 on Tuesday July 05, 2016 @10:35AM (#12036687)
> ...and best viewed in [IE6|Netscape|Mosaic|...] pages were everywhere

We have "best viewed in Chrome" today, which is no different.

Re:CSS is powerful, you can do a lot of things without JS by nkassis on Tuesday July 05, 2016 @12:30PM (#12037610)
nope I agree, like I said it's as bad as it ever was. The past wasn't better.
Re:CSS is powerful, you can do a lot of things without JS by oliwarner on Tuesday July 05, 2016 @09:00AM (#12036065)
I would strongly disagree with "totally OK".

A crappy, lazy developer won't care about state history. A good developer will. You can do things right if you want to. It's more work but not a huge amount more.

Re:CSS is powerful, you can do a lot of things without JS by SquareWheel on Tuesday July 05, 2016 @11:39AM (#12037151)
Re:CSS is powerful, you can do a lot of things without JS by Hamcha on Tuesday July 05, 2016 @08:58AM (#12036058)
I have to maintain a web interface with framesets and it's much worse than the React stuff I build. Yes it's "one huge js-dependant page for everything", but it can keep track or where it is (and go back to it) using location.hash or path entirely (if the webserver agrees). So I can fix single page apps, I can't fix framesets.
Re:CSS is powerful, you can do a lot of things without JS by clarry on Tuesday July 05, 2016 @10:27AM (#12036621)
From a user's perspective, what you [as a developer] can or cannot fix doesn't really matter. What's broken is what matters. I find that with the JS craze we've been living for a few years now, things break a lot in the same way they did back in the frameset days. Except that now it is worse in some ways; with framesets, I could link to a specific frame if I wanted. And I could navigate back and forth too, as long as I understood the mechanics behind it. Now with the JS crapps, it's no longer something I can work around as a user.
Re:CSS is powerful, you can do a lot of things without JS by sanderjd on Tuesday July 05, 2016 @10:34AM (#12036679)
> JS crapps

Just as a pointer, using this "portmanteau as diss" discourse style is generally a bad idea if you want to be persuasive to people who aren't sure yet whether or not they agree with you, rather than just "preaching to the choir" who already share your views. The rest of your comment made some decent points, but name-calling like this just comes off as childish.

Re:CSS is powerful, you can do a lot of things without JS by ceejayoz on Tuesday July 05, 2016 @10:53AM (#12036824)
Every modern framework I'm aware of has either built-in or popular third-party routers that use HTML5's History API to make the back button and links work just like they'd work in a static HTML-only site.
Re:CSS is powerful, you can do a lot of things without JS by iamtyce on Tuesday July 05, 2016 @09:14AM (#12036160)
Autoprefixer and prefixfree allow for writing 1x declaration and as support improves over time the prefixes are automatically dropped from your build.
Re:CSS is powerful, you can do a lot of things without JS by nostrademons on Tuesday July 05, 2016 @12:17PM (#12037503)
The browser prefixes haven't been necessary on transition for almost 3 years now:

http://caniuse.com/#search=css%20transition

This is just a webdev with old habits that isn't staying current.

Re:CSS is powerful, you can do a lot of things without JS by ricardobeat on Tuesday July 05, 2016 @07:43AM (#12035721)
transition has been standardized and available in all browsers for years already, that is only necessary as fallback for very old browsers.
Re:CSS is powerful, you can do a lot of things without JS by talmand on Tuesday July 05, 2016 @10:49AM (#12036793)
The only reason I use the webkit prefix on transition is for Android, otherwise I would say it isn't necessary at all.
Re:CSS is powerful, you can do a lot of things without JS by ry_ry on Tuesday July 05, 2016 @12:26PM (#12037581)
Still a suprising number of old safari builds out in the wild, from a very quick look at our GA. Largely elderly iphones I assume?

Either way, I'm reticent to pull the WebKit prefixes from our mixins for now.

I wonder if my employers would be interested in releasing (& aggregating with other relatively large sites) our browser usage stats to create a categorised set of current 'real world' stats?

Re:CSS is powerful, you can do a lot of things without JS by zeveb on Tuesday July 05, 2016 @10:15AM (#12036548)
I think we learned from X- headers and x- media types that vendor prefixes are a mistake: inevitably one must support vendor-prefixed keys forever. That's why that practice is no longer recommended: just use the right key, and specify it properly so others may support it as well.
Re:CSS is powerful, you can do a lot of things without JS by toomanythings3 on Tuesday July 05, 2016 @08:18AM (#12035861)
The W3C's job is to standardize implementations. Most standards bodies do not invent on their own. In any case, a standards body will generate the fundamentals allowing the ability to piece together components to create what a developer wants. No standards body is able to come up with every desire of every developer.
Re:CSS is powerful, you can do a lot of things without JS by achairapart on Tuesday July 05, 2016 @08:46AM (#12035976)
The point is: Usually, you must know the rules to break them. In this particular context, looks like the original rules are fading away.

No rules = Anarchy.

Re:CSS is powerful, you can do a lot of things without JS by nilved on Tuesday July 05, 2016 @12:16PM (#12037488)
Nitpick, but anarchism is not the lack of rules, it's the lack of rulers.
Re:CSS is powerful, you can do a lot of things without JS by Piskvorrr on Tuesday July 05, 2016 @03:56PM (#12039070)
That's not really a nitpick: in case of the Internet, it's the main modus operandi - with various warlords carving out a temporary fiefdom here and there (remember the Browser Wars, when IE had 90%? Brace yourselves, we're headed for a re-run with Chrome), but no actual rulers or enforcement.
Re:CSS is powerful, you can do a lot of things without JS by achairapart on Tuesday July 05, 2016 @12:35PM (#12037648)
My bad, thanks for pointing it out.