Live data from Hacker News

Enough with the JavaScript already

fr.slideshare.net

51–60 of 231 posts

Re: Enough with the JavaScript already

#51
post #44

Enough with the no-context-attached slides already. Seriously, if you don't have a recording of the talk, or a transcript, at least provide an article or something.

I will never understand the utility of posting slides from a talk online without the audio.

Re: Enough with the JavaScript already

#53
post #50
post #47

Earlier quoted context omitted.

It does not however, preclude the possibility that the tool is in fact a bad tool, and that the tool is bizarrely the only tool we have. They say poorly skilled people blame their tools, and that highly skilled people who know their tools well, will know how to use it well. That being said, see that circular saw over there that will occasionally bounce and cut off its user's fingers? I'm not gonna use it, no matter h…

Yeah JavaScript has problems, so do all programming languages. JS has some particularly egregious ones, but the abuses and problems the slide complains about are not a symptom of a defect with JavaScript. They would be the same problems with any other language being used by incompetents.

I like to think of it this way: Some languages allow you to shoot yourself in the foot easier than other languages, given the context and environment.

Abuses and problems precisely show Javascript's defects. The more easily abusable a language is, the more defective it is.

A lot can be said about familiarity with the language. Many examples in wtfjs.com boils down to (mis)understanding the language itself. Let's call this the cognitive overhead of a language - the amount of corner cases you have to store in your head about a language.

Surely a language with high cognitive overheads is more abusable than languages that have low cognitive overheads.

Incompetent python, C, or even scheme programmers wouldn't be able to shoot themselves in the foot (by shooting themselves in the foot, I mean having unexpected results - even with Undefined behaviours) as much as incompetent javascript programmers. That's my beef. I currently have no way of empirically proving that, but my gut is leaning that way.

Re: Enough with the JavaScript already

#54

Earlier quoted context omitted.

Dart ( http://www.dartlang.org ) is a attempt by Google. Of course, probably no browser except Chrome (and Opera?) will ever have the Dart VM built-in, but Dart also compiles to javascript for those other browsers.

An issue with Dart is it does not support IE 8. IE 8 still ships with Windows 7 and it is quite popular. It's not reasonable to throw away all IE 8 traffic just to get Dart's features.

IE8 usage is under 8% so it's possible for some people/organizations to stop supporting it. In another year, I would expect market share to be under 5%.

http://gs.statcounter.com/#browser_version-ww-daily-20130615...

IE10 has more usage. Hopefully, Win 8.1 is successful for Microsoft and XP usage drops significantly.

Re: Enough with the JavaScript already

#55
post #27

All the includes are insane as well. Run Noscript or any other JS blocker and visit a few big sites and you'll see that you end up running JS from half the Internet. I'm joking of course, but some sites have dozens of includes from other sites, advertisers, CDNs, etc.

I installed Ghostery but did not set up any filters; with just that, it shows how much external resources / from which external parties things are loaded. Some sites have like twenty external dependencies, and multiple analytics gathering scripts (which may get embedded via the iframes of advertisers).

I work in advertising. I have seen Ghostery rack up close to 300 trackers before. Piggybacked pixels... they're everywhere

Re: Enough with the JavaScript already

#56

I wonder if there'll ever be an alternative to Javascript. I'm not talking about those things that eventually get translated to Javascript, I'm talking about a native platform well thought-through and based on a typed language that isn't a mess. Yeah, I know: it's not Javascript that's broken, it's the DOM. I'd argue that both should be replaced by something else, otherwise the future will be 90% native mobile apps,…

Absolutely. Write in whatever language you like, compile to asm.js - that way you're running in the browser, at about half native speed.

"Write in whatever language you want" - For languages that need a VM (most garbage collected languages for example) you would need to port the VM to asm.js. That's a job in itself. Then when a user hits your site they would need to upload all the asm.js for the VM at least the first time (think about that on a sketchy mobile connection). On top of that the performance of C++ to asm.js is about half native. The performance of e.g. a ruby interpreter running in a VM that was ported to asm.js could be a long way off native. The performance of e.g. Ruby might be acceptable on a server where you can throw more horsepower at it. But on a client? Client code is the most performance critical there is. The user expects instant feedback when they swype. Even if there was a native Ruby VM (for example) on the client it still might not meet your performance requirements not to mind one that runs in asm.js. It was the movement back to the server side with web programming that enabled the diversity of language use in the 90s. On the client the same old restrictions apply i.e. we would need something to make those VM's faster than their native versions, not slower.

Re: Enough with the JavaScript already

#57
post #47

Earlier quoted context omitted.

It does not however, preclude the possibility that the tool is in fact a bad tool, and that the tool is bizarrely the only tool we have. They say poorly skilled people blame their tools, and that highly skilled people who know their tools well, will know how to use it well. That being said, see that circular saw over there that will occasionally bounce and cut off its user's fingers? I'm not gonna use it, no matter h…

People don't use javascript because it's a beautiful, well thought out language. They use it because it runs everywhere .

Here's the painful part: Douglas Crockford wrote a book called Javascript, the Good Parts.

If Javascript were limited to The Good Parts alone, it has the potential to be a beautiful well thought out language. It would be quite close to a beautiful well thought out language

Re: Enough with the JavaScript already

#58
Javascript itself has warts and they are easily overcome. I've found that the biggest hurdle for me, someone who's written native desktop applications, are the libraries are a huge hurdle. I still don't understand the obsession with MV* "design patterns," in GUI code.

It's made worse by the fact that the model we have to base our GUIs off of is a based on hierarchal documents.

Re: Enough with the JavaScript already

#59
Before "js everything", it wasn't just a plain simple pure web. It was flash and gifs and "dynamic html" that would break in half of the browsers, and you'd show a special version of your site saying "we're not paid enough to support your browser, go get another one".

Clients never were reasonnable in their demands, nor did most of the site owner have good and simple tastes and care about efficiency, nor did half of the internet care about user experience first above everything else.

Saying that the use of js has because heavy handed is cool and fun, but for any serious discussion there should be more acknowledgment of why we are in this situation in the first place. I'm not sure it's so much worse than 5 years before, at least we can read most things on mobile devices.

As a side point, I've done project on ultra weak platforms were every js had to be hand written to gain speed and memory space. I wouldn't try to do the same on some cookie cutter corporate site with a 600k slideshow loading on the front page, where having easily replacable components and tried and true pieces to test on the 20 combinations of browsers is far more critical that cutting 20k of compressed script.

Re: Enough with the JavaScript already

#60
post #55

Earlier quoted context omitted.

I installed Ghostery but did not set up any filters; with just that, it shows how much external resources / from which external parties things are loaded. Some sites have like twenty external dependencies, and multiple analytics gathering scripts (which may get embedded via the iframes of advertisers).

I work in advertising. I have seen Ghostery rack up close to 300 trackers before. Piggybacked pixels... they're everywhere

How does one even collect the data from 300 trackers?
Post reply on HN