News for hackers. Stuff that matters.
Re:The new Digg by freehunter on Wednesday August 01, 2012 @08:23AM (#4322449)
The layout breaks without javascript on

I see this bandied about on reviews of various sites, and I continue to believe it doesn't matter. If you have Javascript turned off and a page doesn't load, you should know why that page isn't loading. It's because you deliberately broke it for yourself.

Re:The new Digg by blauwbilgorgel on Wednesday August 01, 2012 @08:45AM (#4322532)
You are free to believe that. But let us say I want to cater both to you and to another user that browses the web with NoScript (assume it is my goal to cater to as many users as possible). I have two options: A) make the layout accessible without JavaScript B) break the layout without JavaScript. Only with option A do I cater to both of you -- Regardless of deliberate breaking or bandied opinions ("Thou shalt never mix style and script").
Re:The new Digg by mistercow on Wednesday August 01, 2012 @10:29AM (#4323043)
>assume it is my goal to cater to as many users as possible

The thing is, it's not your goal to cater to as many users as possible. It's your goal to optimize your ROI on development time. The reason we have to have laws about accessibility is that your average fast food place knows that wheelchair-bound hamburger sales will never make back the cost of constructing a wheelchair ramp. The economics of the situation wouldn't provide for disabled people, so we have to have regulation to make sure they get taken care of.

(And before anyone jumps on that and misinterprets me, I am not comparing disabilities to turning off JavaScript. I'm simply showing by example that it is not good business to try to grab every possible customer at any cost.)

Re:The new Digg by dclowd9901 on Wednesday August 01, 2012 @11:22AM (#4323368)
Indeed, I think your accessibility argument is spot-on. The same issues apply for making websites accessible. Thankfully, more often than not, it behooves a site to follow accessibility, because it falls in line with semantic web design, which in turn plays better with Google. Google search, in a way, is the regulatory body to keep sites semantic and accessible.
Re:The new Digg by 385668 on Wednesday August 01, 2012 @08:29PM (#4326539)
That's true, and at some point, I assume they'll make the site play well with noscript, but they've written the new version of the site from the ground up in six weeks with ten people. I'll give them some time to get things right.
Re:The new Digg by mirkules on Wednesday August 01, 2012 @12:26PM (#4323842)
I'm tired of having this argument over and over again, so let's approach this Javascript issue from a different angle:

It is bad practice to couple content (the "what") with functionality (the "how"). The content itself should not depend on how it is displayed. From an engineering standpoint, this makes your code unmanageable and unmaintainable in the long run. These stupid shortcuts of forcing users to have Javascript on just to display content only cause me minor inconvenience, but it will cause you much more harm when it's maintenance or upgrade time.

But you or everyone else on the JS bandwagon don't need to listen to me - I'll "temporarily allow" only the minimal amount of scripts on your page to see what I want to see and I will move on. You will need to live with this code during the next update cycle.

Re:The new Digg by mistercow on Wednesday August 01, 2012 @04:33PM (#4325506)
That's a rather egregious false dichotomy. You can separate your content completely from your JavaScript code, but that does not mean that your content is formatted as plain HTML. In fact, I would argue that storing your content within a page's HTML structure while separating content and functionality is exceedingly difficult, and that if you want to maintain that separation of concerns, you need to store your data in a totally separate format, and then write code that generates the HTML structure based on that format.

Then, taking that HTML and enhancing it with JavaScript (aka progressive enhancement) is also a violation of separation of concerns, and I would argue against it in any but the very simplest of cases. Instead, you should use JavaScript to operate on the raw data and display it to the user. You can then also write server-side code that generates a plain-HTML rendering of that same content, but that is more work, and that means it's a trade-off.

And I think in many cases that trade-off is worthwhile. But this idea that it somehow saves you time in the long run and doesn't end up costing you is pure fantasy.

>But you or everyone else on the JS bandwagon

God, that's annoying. My pointing out a flaw in a particular argument does not imply that I am "on the bandwagon" opposing that argument. I think that making your content accessible without JavaScript is a good idea whenever possible, but I do not think it is useful to pretend that you can do so without trade-offs. I don't have to agree with an argument just because I agree with its conclusion.

Re:The new Digg by eps on Wednesday August 01, 2012 @01:04PM (#4324127)
There are certain design elements that translate into a single line of JS, but require a couple of pages worth of CSS voodoo. Guess what's more maintainable.
Re:The new Digg by mirkules on Wednesday August 01, 2012 @01:47PM (#4324461)
So we compensate for a lack of CSS libraries by mixing presentation layer with content layer. Nice.
Re:The new Digg by eps on Wednesday August 01, 2012 @02:25PM (#4324715)
You brought up the maintenance angle, and the response to that is that in some cases it's far more practical to use js for atyling than to rely purely on css. I gave an example below - a sticky page footer - do show me how to do it in the confines of your abstraction model.

Abstarting things for the sake of abstracting is a rather naive approach. It's a good starting point, but some abstractions complicate things way beyond what's needed.

Re:The new Digg by mirkules on Wednesday August 01, 2012 @02:57PM (#4324885)
While I agree that exceptions in very rare cases are needed, exceptions are becoming the norm and, like I said, are coupling functionality and content. This is why CSS was created, to decouple style from content, and now? We are are throwing all that work away because an entire generation of web devs are just too lazy to look it up.

By the way, a quick search for sticky page footer on Google turned up this as the first result -- no JS needed, and it didn't even look that hard (http://www.cssstickyfooter.com/using-sticky-footer-code.html).

Re:The new Digg by huhtenberg on Wednesday August 01, 2012 @03:27PM (#4325078)
All CSS solutions, including yours, require vertical margins on all page elements to be 0px, which is clearly an obscure and senseless restriction.
Re:The new Digg by papsosouid on Wednesday August 01, 2012 @02:09PM (#4324600)
Such as?
Re:The new Digg by eps on Wednesday August 01, 2012 @02:16PM (#4324646)
Sticky page footer.
Re:The new Digg by papsosouid on Thursday August 02, 2012 @02:32PM (#4330221)
That requires a whopping 3 lines of trivial css, what are you talking about?
Re:The new Digg by tripzilch on Friday August 03, 2012 @01:16PM (#4334979)
Not to mention, they're annoying as hell, especially on a 1366x768 screen. I wish I could get rid of them by simply turning off Javascript :)
Re:The new Digg by eps on Friday August 03, 2012 @10:38PM (#4337282)
Do tell.

Sticky footer - an element that sits at the bottom of either window or the content area, whichever is furtherest down.

Re:The new Digg by freehunter on Wednesday August 01, 2012 @03:21PM (#4325037)
What if the "what" goes hand in hand with the "how"? A distinctive layout could be of more value than the content, especially when it comes to social media (where the content is roughly the same everywhere you go). What's better, a site that doesn't display until you enable JS (then it displays perfectly) or a site that works without JS, but looks awful and drives away users? If you can't understand that the site doesn't load because you have JS disabled, you won't understand that the site looks like shit for the same reason.
Re:The new Digg by nowarninglabel on Wednesday August 01, 2012 @02:17PM (#4324656)
You realize, many countries, most importantly the U.S., have laws regarding making web sites accessible? Section 508 requires that they work with Javascript off. This applies mostly to government sites, but was also used in a case against Target, in which Target lost and was forced to make their website more accessible.
Re:The new Digg by mistercow on Wednesday August 01, 2012 @02:57PM (#4324888)
Target's situation was a bit of a special case, however, as it has a brick and mortar store, which the court found their website was essentially a component of. If your business is completely web-based, the question of whether section 508 applies to you is, as far as I know, untested.
Re:The new Digg by freehunter on Wednesday August 01, 2012 @09:17AM (#4322663)
The problem with NoScript is that it intentionally breaks the intended functionality of a website. I just went into the Firefox element inspector and deleted the code for the list of links on the HN homepage. Now they're gone! How dare PG not cater to my will to randomly disable parts of the website?

You're free to browse the web with parts of it turned off. But you should expect that parts of it might not work, and if they don't work it should be immediately obvious why. Could Digg make it fall back? Yes. Should they? Only if they really want to. It seems they don't really want to. No one wants to cater to IE6 users, either.

Re:The new Digg by cutie on Wednesday August 01, 2012 @03:55PM (#4325256)
No, the web is constructed of separate markup, stylesheets, and code for good reasons. If you prefer a tangled, dependent mess enjoy the results. The advantages to a separation of concerns and the security risks of javascript are real. Otherwise, why not just go back to the bad old days of single, giant pages containing everything?
Re:The new Digg by jamesbritt on Wednesday August 01, 2012 @04:49PM (#4325602)
You're free to browse the web with parts of it turned off. But you should expect that parts of it might not work, and if they don't work it should be immediately obvious why.

Yes, it should be immediately obvious, but often it isn't, and that's my biggest complaint with sites that rely on scripting for basic behavior.

Too many times I've filled in a form, hit the Submit button, only to find that proper form submission does not work without scripting. Nothing on the page warned me, nothing stopped me from filling in the form, even though there are snake-simple ways to tell no-scripters of missing behavior, or to simply prevent bad behavior when scripting is turned off.

(The other complaint I have is why sites rely on scripting to do things that are baked into HTML. For example, using divs as text areas instead of, say, using a textarea as a text areas.)

Re:The new Digg by freehunter on Wednesday August 01, 2012 @07:47PM (#4326414)
Your final note is accurate, yes. But honestly, why should a web developer have to account for your niche-case decisions? Javascript is a perfectly valid language, and it's perfectly valid to assume that Javascript works in a browser since... it does. Normally. Why should I or anyone else have to add code specifically to tell users of NoScript that they need to be reasonable? You don't have to tell users of Mosaic that they need to upgrade to a browser made in the last 15 years. It's pretty obvious at this point.

I use AdBlock and Ghostery to disable ads and Facebook buttons. But when I get to a sign in page and there's no links, I know that it's a Facebook login button. When I watch a video on Hulu and it doesn't load, I know that AdBlock is preventing me from seeing that show. But I don't go on forums and complain that developers should cater to me breaking their websites. I say to myself "oh hey, I've made a choice that broke this site. Let me take 5 seconds to fix it myself."

"Your site doesn't work with NoScript" means the same thing to me as "they don't speak German at the Chicago McDonald's". I mean, that sucks for you, but honestly do you ever step back and wonder why that is?

Re:The new Digg by jamesbritt on Thursday August 02, 2012 @12:56AM (#4327349)
"Your site doesn't work with NoScript" means the same thing to me as "they don't speak German at the Chicago McDonald's".

Not by a long shot. More like a sign in Braille explaining how to get further assistance if needed because not every sign the place may be accessible to the sightless.

Why should I or anyone else have to add code specifically to tell users of NoScript that they need to be reasonable?

Because so many sites use unreasonable scripting. NoScript is a reasonable defensive move because of too much aggressive scripting.

Honestly, do you ever step back and wonder why NoScript even exists?

Bottom line, though, is nobody has to do much of anything for anyone, and it's entirely up to the site owner to decide how they treat people with NoScript and what it's worth to add an additional 20 character or so of boilerplate text to a page.

If nothing else it's a courtesy.

It's just like smiling at people you deal with in stores or holding doors open for strangers. Do it, don't do it, whatever you think is proper. Make the world you want to live in.

I get that my choices are niche, and that's OK. I can live with the downsides. There are very, very few sites I can't simply close a browser on if I don't care for how it's presented for me. No one loses any sleep.

I suspect most people with NoScript use default blocking and whitelist sites as needed. So if I get a clear sign that I need scripting before I start doing anything, and it looks worth it, it's easy to allow the domain. That doesn't require any real effort from a developer, and if that's considered catering then we're all screwed.

Re:The new Digg by eps on Wednesday August 01, 2012 @01:00PM (#4324087)
Catering to NoScript users is dead simple - show them a broken website and they will whitelist it.

Seriously though, NoScript user base is - and let me really blunt about it - a vocal minority with a bloated sense of entitlement. Catering to them makes no practical sense. There are obviously edge cases, but the best option is to put up a note that JS is required. If Digg doesn't have it, they should add it, but beyond that it's money wasted.

Re:The new Digg by brigade on Wednesday August 01, 2012 @04:34PM (#4325508)
I see it the opposite - website designers have decided that they are entitled to decide what my keys and mouse clicks do, among other immensely annoying things.

In short, no you are not. Get over yourselves.

Re:The new Digg by eps on Wednesday August 01, 2012 @11:38PM (#4327125)
Well, there you go - a sense of entitlement. You are visiting other people's virtual property and yet you have a nerve to demand how they should be serving you their content. Do you not realize how ridiculous it sounds?
Re:The new Digg by baby on Wednesday August 01, 2012 @05:11PM (#4325740)
I bet you're less than 1% of digg's traffic and you just have to disable noscript to be able to browse it. It's not like you're stuck on IE because of your job.
Re:The new Digg by brigade on Wednesday August 01, 2012 @05:28PM (#4325851)
What does IE have anything to do with this?

I was pointing out that from my perspective, the entitlement of web developers has gotten so out of control that disabling JavaScript is the best way of making the general web tolerable to browse.

Re:The new Digg by freehunter on Wednesday August 01, 2012 @08:17PM (#4326503)
IE has to be specifically coded for because it doesn't support modern web design fundamentals. NoScript users have to be specifically coded for because of the same reason.

How often do you run into a website with Javascript that breaks your experience? Would it not be better to have a blacklist than a whitelist?

Re:The new Digg by alter8 on Thursday August 02, 2012 @10:32AM (#4328912)
When I run into a website that breaks my experience, it slows down my computer, crashes the browser and takes away the comment I was about to write. No, thanks.
Re:The new Digg by freehunter on Friday August 03, 2012 @02:30AM (#4332834)
So then we're back to the previous comment: what does IE have anything to do with this? If your browser crashes because of a misbehaving script... I'm not saying you're using IE, but you're surely not using a browser that fits your needs. Chrome simply crashes the tab, and Firefox hangs for a few seconds until it asks if you want to stop the script.

What you're looking for is browser sandboxing, and it exists.

Re:The new Digg by moheeb on Wednesday August 01, 2012 @06:05PM (#4326027)
I highly doubt that brigade is 1% of Digg's traffic.
Re:The new Digg by cutie on Wednesday August 01, 2012 @04:20PM (#4325402)
If you need code to display a text document, you're doing it wrong.

There is a philosophy (with some merit) of worse is better. So, let's be honest... you're promoting sloppy coupling in order to save developer time. The problem is that the technical debt will have to be paid back in the future.

Re:The new Digg by ruswick on Wednesday August 01, 2012 @10:32AM (#4323069)
It wasn't their goal to cater to as many users as possible.

Their goal was to build a MVP as quickly as possible.

Re:The new Digg by damncabbage on Wednesday August 01, 2012 @09:32AM (#4322715)
Counterpoint: Twitter went "down" for five hours about five months back because someone typo'd true in the blob of javascript it serves up.

If your site still works without javascript, at least something will work if a bug slips through to production.

(I agree with you for the most part; it's just when even page navigation breaks it can get more than mildly annoying.)

Re:The new Digg by polyfractal on Wednesday August 01, 2012 @10:48AM (#4323152)
This is a silly argument. You could just as easily put a typo in your apache/nginx config and nuke your site. It has nothing to do with gracefully degrading with respect to javascript
Re:The new Digg by orangethirty on Wednesday August 01, 2012 @08:37AM (#4322496)
I disagree. They broke it by not providing a fallback option. You always provide a fallback option, even if it is a simpler website.
Re:The new Digg by daleharvey on Wednesday August 01, 2012 @08:57AM (#4322591)
You dont always do anything, you compare the cost of the effort against the value added, if its not worth doing, then people wont do it
Re:The new Digg by orangethirty on Wednesday August 01, 2012 @09:19AM (#4322665)
Not worth keeping your brand looking right? This is not about code, this is about their brand and how they protray themselves. If people see a broken website (for any reason, be it cookies, JS, or whatever), they will think less of the brand.

Like you said, "...you compare the cost of the effort against the value added". It does not add anything to the brand, but not having a fallback takes away from it. And given Diggs current reputation, they need all they can get.

Re:The new Digg by daleharvey on Wednesday August 01, 2012 @09:43AM (#4322771)
If >1% see a broken website, and >99% see them reviving a dead platform extremely quickly

It is their tradeoff to make, personally I think they are making the right one.

Re:The new Digg by orangethirty on Wednesday August 01, 2012 @10:09AM (#4322913)
Honestly, how much time can including a <noscript> tag can take?

Simple as:

<noscript>Digg is awesome with javascript turned on.</noscript>

on top of their other markup. That's it. Twenty seconds tops.

Re:The new Digg by dt7 on Wednesday August 01, 2012 @08:50AM (#4322556)
A <noscript> tag would suffice.
Re:The new Digg by TazeTSchnitzel on Wednesday August 01, 2012 @09:34AM (#4322726)
This is what I do. Most of my stuff degrades gracefully, but for the few things which can't (JS demos/game things), I generally do something like this:

  <noscript>example.com is a HTML5/ES5/CSS3 3D graphics demo. Unfortunately, your user-agent doesn't seem to support ES5, sorry about that.</noscript>
Re:The new Digg by SimHacker on Wednesday August 01, 2012 @01:10PM (#4324163)
Or you could phrase without all the academically correct technical buzzwords, so normal people who are your real audience will understand what you're trying to communicate. Like using "JavaScript" instead of "ES5" and "web browser" instead of "user agent".
Re:The new Digg by awj on Wednesday August 01, 2012 @03:05PM (#4324940)
> Or you could phrase without all the academically correct technical buzzwords, so normal people who are your real audience will understand what you're trying to communicate.

Normal people who are my real audience probably don't even know how to disable javascript, and most likely would enable it with no fuss if something looked broken.

Re:The new Digg by TazeTSchnitzel on Thursday August 02, 2012 @06:48AM (#4328128)
My target audience know what it means. Web devs.

For more general population-oriented sites, I have smiley faces and "JavaScript" and "Web browser".

Re:The new Digg by qq66 on Wednesday August 01, 2012 @03:04PM (#4324928)
That's not entirely true, there are hundreds of millions, if not billions, of people who use the Web only through a phone, usually a featurephone, and mobile phone Javascript is broken or nonexistent on many of these platforms. These are lower-revenue users, for sure, but there are a LOT of them.
Re:The new Digg by freehunter on Wednesday August 01, 2012 @03:19PM (#4325026)
In that situation, wouldn't it make more sense to show them a completely different site based on browser id? Not just one that doesn't rely on Javascript, but has a completely different layout entirely?

I would still question the millions or billions of users who view the web only on their non-smart-phone who will be using social media like Digg.

Re:The new Digg by qq66 on Friday August 03, 2012 @08:30PM (#4336920)
I know from firsthand experience, ignoring Digg for the moment, that there are at least 500 million people who use a featurephone in India to check news, cricket scores, horoscopes, make payments, send emails, and send text messages. Their threshold for device frustration is much higher than mine.
Re:The new Digg by gcr on Friday August 03, 2012 @12:26PM (#4334675)
Tell that to a blind user. Let's see how they react.

If you have a site that breaks without javascript, you are leaving a significant portion of your customer base on the table.