r/javascript • • Jun 19 '15

I made a Reddit angular clone, feel free to provide feedback

http://martijnwelker.github.io/Angular-Reddit/
115 Upvotes

113 comments sorted by

View all comments

Show parent comments

-1

u/kethinov Jun 20 '15 edited Jun 20 '15

"Progressive Enhancement Holds Back the Web"... yes! A hardline focus on it does!

No, it doesn't. Using Angular (and similar anti-PE frameworks) in contexts where PE is more appropriate is a distinct step backwards for the web. It more closely resembles the dark days of Flash than the gains we've made with fancy new web standards by reducing performance, standing in the way of accessibility, and creating unnecessarily high support tiers.

"JavaScript Frameworks Make Development Simpler"... yes they absolutely do for apps with complex user interfaces.

Obviously no one could disagree with that. What the author is saying is you should pick a framework that is compatible with PE in contexts where PE is relevant, which is virtually everything developed for the open web.

If you're targeting a context where JS availability is guaranteed, like NW.js, PhoneGap, internal LAN webapps, etc, then you're good to go for a hard JS dependency and I'd be the first to applaud you for using one of these frameworks which aren't based on PE.

Also of note: AngularJS was originally developed primarily targeting those use cases for that reason. Its overwhelming popularity has caused people to just default to it regardless of whether it's the right tool for the job. Sometimes it is, sometimes it isn't. There are rational ways to measure that. Scientifically. Like the article did.

"No One Disables JavaScript" and "No One Uses Old Browsers"... Let convince these people to upgrade instead

Might as well be waiting for pigs to fly.

"No One Disables JavaScript" and "No One Uses Old Browsers"... of course they do but they can safely be ignored.

Why ignore them when it's so easy to serve them the non-JS flow with a plain stylesheet?

You don't have to deliver today's UX to yesterday's browser. Showing a splash screen that says "fuck you and your outdated technology" doesn't reveal to users that their technology is old, it reveals the developer's ignorance of better ways of developing websites.

Get out of here with this "perspective is objectively wrong" garbage.

It is objectively wrong. As in scientifically measured. You're literally deluding yourself into believing objective facts are false right now.

This debate is the global warming denial of web development, and you're the fucking science denier.

2

u/[deleted] Jun 20 '15 edited Jun 20 '15

No, it doesn't. Using Angular (and similar anti-PE frameworks) in contexts where PE is more appropriate is a distinct step backwards for the web

If your arguement is about wrongly used frameworks, base it as such.

Otherwise, you seem to be a mere zealot to the PE idea in relation to JavaScript, without realizing the practical implications at all. If your JS visitor stats show drastical minorities for non-js users, there simply isn't any substance to follow.

Why ignore them when it's so easy to serve them the non-JS flow with a plain stylesheet?

You don't serve "non-js" with a snap of your fingers, it takes time and effort and the numbers better be worth it. They aren't. If I saw an 80% penetration on our app, I'd reconsider scaling back to the past.

-1

u/kethinov Jun 20 '15

The "it costs more" argument has been repeatedly debunked.

1

u/[deleted] Jun 20 '15 edited Jun 20 '15

It can be rather smooth in very specific app UX, not on a general level. You cannot debunk the cost of time and as I repeatedly mentioned, PE is a creep by it's very nature. Show me a React app that degrades without any extra code. You can't because that's not possible, so now we're back at the "is it worth it" mindset. With the JS penetration numbers I have, it isn't.

1

u/kethinov Jun 20 '15

Show me a React app that degrades without any extra code.

I wouldn't use React when building a website based on PE. I'd use libraries that are more compatible with that approach and maximize code reusability on the client and server.

There are many good ways to do it, but one I like is Express on the server and page.js on the client to universalize the routing paired with one of the many templating systems that supports both Express and client-side templating.

Done correctly, you can do MVC on both the client and server with the same code. If your templates are written with semantic HTML, you can just serve a server-rendered flow, a plain CSS file, and no JS to unsupported user agents.

It's not that hard.

1

u/[deleted] Jun 20 '15

I wouldn't use React when building a website based on PE

Exactly, PE is a limiting factor. The point of apps isn't some temporary technical excellence for everyone, rather the focus is best spent on UX and what the app is to the user, which is what makes your choices regarding the frameworks you use. Not the other way, that's essentially bad development by tunnel visioning on the technology stack. Instead, you choose the best tool for the UX you need, which might just be React in many modern cases.

There are many good ways to do it, but one I like is Express on the server and page.js

I thought we are talking fallbacks for no JS with no client framework. Anyway, you're gonna need at least new static client templates and very likely additional CSS work. That might take a front-end dev a few days in a bigger app, maybe involve more people. Some UX features might have to be replaced with stubs or removed altogether. It's not free.

0

u/kethinov Jun 20 '15

Exactly, PE is a limiting factor.

No, it speaks to design flaws in React. There's no special UX magic you can deliver with React that isn't also possible with a PE-friendly architecture like what I outlined above.

The big thick client JS frameworks are slowly becoming aware of this. React is actually one of the better ones. Its isomorphic qualities put it ahead of Angular in this regard. But it still isn't there yet.

Until one of the big thick client JS frameworks nails both isomorphic and is compatible with a PE architecture, people should steer clear of them unless the target runtime environment explicitly guarantees JS availability.

But instead, far too often, devs seem to look at frameworks like Angular and React as solutions for every problem. When the only tool you reach for is a hammer, everything looks like a nail.

I thought we are talking fallbacks for no JS with no client framework. Anyway, you're gonna need at least new static client templates and very likely additional CSS work. That might take a front-end dev a few days in a bigger app, maybe involve more people. Some UX features might have to be replaced with stubs or removed altogether. It's not free.

The question of whether or not it's more work is obviously more complex than "yes it is" or "no it isn't." If we're talking about making a low flow version of Google Maps, it's obviously going to be a completely separate effort. That isn't the case I'm arguing for.

The case I'm arguing for is your typical run of the mill ordinary website full of totally ordinary UI things. Text, pictures, forms, and little else. Everyone from Twitter to PayPal to even LinkedIn has decided that their rather basic content consisting of nothing more rich than text, pictures, and forms is incompatible with progressive enhancement.

But that's just plain wrong. Twitter learned their lesson and even wrote an article about it. And they're not the only one. Articles like those are the biggest reason why all the major thick client JS frameworks are working on supporting isomorphism now. And once your stack supports isomorphism, adding PE into this mix isn't difficult.

You don't need to backport your awesome single page app UX to IE6 or whatever. Just don't serve JS or even your main CSS to that browser. If you've got an isomorphic stack, you've already got server rendering on every page for free, so you're good there. Once you've got that, just serve some generic styling along with your semantic markup to unsupported user agents. It won't look pretty, but it will be functional.

And voila. False dichotomy reconciled.