Hacker News new | ask | show | jobs
by AndreyErmakov 3637 days ago
If I may contribute to the article somehow, I'd tell people this: stop using JavaScript for basic markup. I sigh every time I visit a site whose entire navigation structure is spit out in front of me as a disorganized wall of text, and only when I enable JavaScript that mess gets cleaned up and arranged back into something organized. It's just no way to design pages. CSS is for visual appearance and styling. JavaScript is for interactivity. If you can't give your site a proper look without resorting to JavaScript then you have no business designing web pages yet and need to go learn the basics first.
2 comments

Most of enterprise development is on rich web apps that couldn't work at all with javascript. Saying that people who write javascript and don't use semantic html need to "learn the basics" is like complaining about people typing emails instead of hand-writing letters in cursive.

People like yourself who want HTML fallbacks for everything have a fundamental misunderstanding about the nature of technology. At some point, it doesn't make sense for the biggest roads to have support for both cars and horse-drawn wagons.

Any road will support a horse-drawn carriage. Unless you take extraordinary measures and start building vehicles using wheels with special profiles for which custom-designed roads will be necessary where those wheels will be held on track like with trains.

Naturally horses will stumble on those, and people like you will say the others don't understand the nature of transportation and should get rid of their old horses and conventional cars.

But perhaps the problem is just with you and you newly designed fancy wheels.

Except you're a a tiny and economically irrelevant minority who own cars but are intentionally disabling them due to some sort of mental block about it not being the year 1994 anymore.

If you want to be Cyber-Amish, that's absolutely your right, but much like the actual Amish, you will need to create your own society that serves your needs instead of trying to drag us back into the past with you.The Amish are not demanding that the International Space Station build a wooden module to accommodate them, nor do they buy plane tickets with the expectation that the pilot will still get them there but won't turn on the engine due to the religious beliefs of a tiny minority. Everyone has the right to unreasonable beliefs, but when they try to be smug and condescending about their own backwardness... yeah. You are the human equivalent of IE6.

> Most of enterprise development is on rich web apps that couldn't work at all with javascript.

Doesn't enterprise development stay within enterprises? As for the public facing web, even if the functionality requires Javascript, having it look like crap without Javascript does seem kind of lazy. I'm even for being lazy, I don't test everything and on every device, but when something is pointed out to me, at least I realize it's suboptimal, and don't rationalize regression into progress.

https://www.w3.org/wiki/Graceful_degradation_versus_progress...

Nothing really changed to make these best practices moot.

Most of the enterprise internet ends up becoming the public facing internet. Enterprise isn't a moral agent for accessibility, it's saying "why should we spend hundreds or thousands of developer hours accommodating less than 1% of the market?"

With rare exceptions, (such as supporting IE6 clones in China) there's no business case for doing so, so it isn't done.

W3 is great, but the very page that information on violates their standards--it's div soup and won't work screenreaders, there are images without descriptions, and even the sidebar is using javascript to open the menu and change classes when it could use pure HTML.

So yes, those best practices are obsolete when the people recommending them can't even be bothered to follow them on their own page.

Thats because CSS is not powerful enough, not helped that you can't use something like flexbox if you need to support old browsers but even the latest version of $YOUR_BROWSER does not have a way to say that I want a list element to layout its elements in one vertical column that is also centered vertically on the screen if it has fewer elements than there is space for on a screen, but having it split into additional columns and align all elements in all columns to the top if there are more elements than space on the screen. It is a fairly simple layout and I ended up having to do it in JS because flexbox only has a few standard modes for what to do when the content overflows and those don't effect the margins of the element.

CSS needs to be replaced with a more capable scripting language, or at least one based on constraints but until that happens we are stuck with javascript.

> Thats because CSS is not powerful enough

This kind of objection is totally missing the point.

And this isn't an argument that CSS doesn't have painful limits (it does) or even about what constitutes "enough" (within its limits, CSS offers enough possibilities that your own ideas of what the app "should" be like may be as much as a limit as the problems of CSS are).

The power of CSS is largely orthogonal to the underlying issue.

Ideally, your web site/app is still usable even with every last stylesheet completely ignored. It should work with Lynx, or with entirely non-visual user agents (screenreaders, search bots, Siri etc).

CSS should enhance via layout and other presentation rules where that's possible.

JS should provide more convenient application behavior where that's possible.

Instead, we've slipped into a space where the browser (and, frequently enough, one browser) is simply considered The VM That Lived™, just another runtime target. And that's a sign of its growing power, and that power isn't a bad thing because there are in fact some applications that don't fit the hypermedia model well and the browser's ability to play the just another runtime role opens a space for them. But the rush to get into that space is considerably overdone and apparently executed without a lot of awareness of what's been lost in moving that way.

Except the vast, vast majority of people don't care and use a normal desktop browser with JS on
My mom just bought a new phone and asks why it's still too slow and clunky like her old one. I found out she likes to click Buzzfeed-esque links from Facebook and most of those sites slow the device to a crawl because of the massive amounts of Javascript running.

People care about the downstream effects, they don't know the how or why, but they care.

In 2014 I bought a ~50$ Android while traveling Latin America. I didn't expect much more of the browsing experience than reading mostly text based articles. But I didn't even get that. Literally half the linked articles I clicked on hacker news led to sites which where close to or impossible to navigate because of JS shenanigans and the assumption of an least a 4G internet connection.

It is especially annoying if one claims to target a world audience, but expects them to have a +500$ phones and vast data subscriptions.

The market fixes this, though. If your websites don't load on a low-end Android over 3G, you won't attract the sort of audience that uses that setup. Conversely, if you know what a large portion of your audience uses specs like that, you'll go through great lengths to ensure your sites are performant and usable.

It seems that most 'western' sites have decided focus on people with desktops or +500$ phones and vast data subscriptions.

In some places, $500 is about a half-year salary from which one has to live and feed their family. Nobody in their right mind would waste it on an electronic toy.
Indeed. I think it’s important for engineers working on any kind of end-user facing software to remember that a lot of people aren’t using cutting edge or even recent hardware. There’s lots of Core 2 Duo laptops and 3+ year old smartphones floating around in use out there and their users need to be able to use the websites and apps we make as much as the guy who buys new everything every year.

I think this is particularly easy to forget for those of us living in tech hubs where everyone is using almost-new Macbook Pros and iPhone 6Ss.

+1

I've never seen that client devs test their apps on lower end devices.

If my users care about and/or use Lynx that I will support it. Until then, it's just a feature that doesn't have the ROI to invest in.
Sure, sometimes you have to make tradeoffs for what you have time to invest in.

But this isn't really about supporting the world's Lynx users specifically. There's a reason I put a whole class of non-mainstream UAs in there (and in particular Siri, given how likely it is that entirely non-visual UAs are to become more mainstream at some point, perhaps soon, on top of the awareness that intermediary UAs like GoogleBot are of course ubiquitous and clearly important). And which UAs you try to support has a chicken and egg effect on which UAs get employed as intermediaries in accessing your site/app... and therefore which UAs you think you see using it. Usage follows accessibility perhaps even more surely than accomodation follows demand.

If that weren't enough, the decision to do the things that would mean that your site is usable in Lynx is not just a feature -- it's also a technical decision. And like other technical decisions (database, language, library, application architecture, idioms and patterns you use, and data serialization/interchange format... which is actually part of what this decision actually is), it matters to how well your product performs and how tractable it is to develop and maintain, as well as how widely it can be consumed.

If you're having to make cold hard decisions about ROI for features, chances are decent that you're better off for thinking about whether it works in Lynx and why, even if not one single user visits with that specific UA.

Fair enough in a way, but on the other hand.. will that be like JPEG2000, which browsers might support when websites use it, which might be when browsers support it?

Or put differently, how would someone who can't use or even see your thing become your user?

When I was a beginner I also tried to design all kinds of fancy, flexible and auto-adjusting stuff. With years I came to the understanding that most of it is just unnecessary and wouldn't diminish the user experience in any way if you didn't do it the fancy way and instead went with a simpler route.

CSS like any technology has its limits. In reality it is often good because it forces you to rethink what you're doing and reconsider whether you really need it. If we had a technology with unlimited capabilities, a lot of developers would be lost there forever and wouldn't be able to accomplish the larger goal completely lost in pursuing all the secondary details they could possibly imagine.

Most of the places I see javascript being used for layout are not doing complex things that can only be done in javascript. At the very least, there should be a non-javascript fallback so the content is visible and somewhat layed out.

All mediums have limitations.

CSS is good enough. It's overdesigning that makes the web the crap it is today.