Live data from Hacker News

Enough with the JavaScript already

fr.slideshare.net

221–230 of 231 posts

Re: Enough with the JavaScript already

#221
post #188

JavaScript assumes a "web browser". What happens when we're not using a "web browser"? A few days ago, I was actually downvoted for even suggesting that a user could disable JavaScript and that this might reduce her vulnerability to exploits. I'm always fascinated by the strength of the bias in favor of JavaScript. I'm guessing that so many developers are now so heavily invested in JavaScript that if it were to becom…

Well , now that developpers can do crazy stuffs with javascript they will never use it responsibly and will show every trick they know to the user, because they want or because their clients want it.

I remember the time when 100ko pages were considered too heavy. now devs dont even bother optimizing images and use 500 ko png logos...

It's not unusually today to see 2MO homepages ...

Re: Enough with the JavaScript already

#222
post #78
post #40

JavaScript is a tool. Once it becomes trendy idiots will always abuse a tool. It's not JavaScript's fault people are bad at web design and development. If it wasn't fucked up JavaScript these people were contacting you about it'd be something else, be glad you have a job.

We are all abusing the technologies originally developed for hypertext documents (HTTP, HTML, CSS, JavaScript) for building applications. If you today started working on a set of standards for handling what people currently build on the web proposing those technologies would be completely ridiculous, so ill suited are they for this job. And JavaScript is probably the worst of all, it is designed badly enough that the…

I think the problem is that the original technologies were bad to begin with. And the development was ad hoc and without foresight. Just look at the history of the img tag (http://diveintohtml5.info/past.html). DOM was tacked on later, JS was developed in a couple of weeks, with Java-like syntax just bolted on for marketing purposes. And CSS is the worst. Why anyone considers cascading to be a feature is beyond me. I mean, what were they thinking, what was going through the person's head when they decided "yep, cascading, that's what we need, forget name spacing, variables or expressions, we need cascading". Oh boy.

Re: Enough with the JavaScript already

#223
post #83

Earlier quoted context omitted.

I understand that the Smalltalk like syntax of Objective C can be difficult to understand at first glance; however, once you've worked with it a bit, the syntax becomes quite expressive -- each argument is labeled; something like using named arguments in Ruby, but it's not optional. Not sure what you mean about the APIs being nasty. Can you elucidate?

https://developer.apple.com/library/mac/#documentation/Cocoa... :

Could you go further? What, in your opinion is wrong with NSString? How would you fix it?

Re: Enough with the JavaScript already

#224
post #181

Earlier quoted context omitted.

> asm.js is JavaScript. It executes according to the semantics specified in ECMA-262. No, it's a strictly defined text-encoded bytecode that happens to be representable using a subset of valid JavaScript. If you deviate from the standard using valid JavaScript, you lose the gains. Calling it "JavaScript" is just a semantic game. You can't output arbitrary but fully 100% standards-compliant JavaScript from a compiler…

> If you deviate from the standard using valid JavaScript, you lose the gains. That's true for lots of JavaScript optimizations. JS optimization is all about speculation that the more dynamic features won't be used. Try adding calls to "eval" within a JavaScript function in any modern JS engine and watch its performance drop by an order of magnitude. Does that make functions that don't use "eval" no longer JavaScript…

Maybe it's time to go back to the HotJava[1] approach and use Java bytecode as the canonical "bytecode for the Web".

OK, to be fair, the browser itself doesn't really need to be written in Java. But other than Javascript, (and maybe Flash, I suppose) Java bytecode probably has the most penetration as a mechanism for delivering "programs" over the web. Maybe we should just embrace it...

[1]: http://en.wikipedia.org/wiki/HotJava

Re: Enough with the JavaScript already

#225

Earlier quoted context omitted.

I assume you would apply the same origin policy to the connections. The firewall point is good, although I don't understand why you would want to block general TCP connections but not websock.

A lot of corporate environments prevent you from connecting to anything but port 80 and 443. Websockets is the only way for you to multiplex your tcp-like connections over port 80.

Right, but I assume they block those other ports for a reason. What is different about websocket that makes that reason no longer apply?

Re: Enough with the JavaScript already

#227
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…

Seriously your analogy is absurd. JS has a few rough edges that any decent editor will warn you about and that you automatically know to avoid after doing a lot of it for even a couple months. This complaining that JS is unusable is just BS and whining by people who are simply shying away from something they don't know. There are bigger things that can bite even experienced developers like memory leaks and bloat but…

Coding JS is 95% of my day job and I'm 100% sure that it is the worst language I have ever used. All languages have flaws but JS's are serious, inexcusable and onerous.

Re: Enough with the JavaScript already

#228
post #98

Earlier quoted context omitted.

What's stopping you from only using the "good parts" in your own code? How is JS a bad tool? It runs reasonably fast, works everywhere, is a small, simple language that's surprisingly powerful. What if Eich had been influenced by C instead of Lisp when creating JS? All things considered, it could have been way worse than it is, and the truth is JavaScript lets you get in there and do good stuff. Not sure why we are s…

I think a lot of experienced developers are only using the good parts, it's difficult to learn but it can indeed be a very beautiful language when you use it with modules/jsLint/jsHint.

What kind of modules do you mean - there are so many kinds in Javascript?

Re: Enough with the JavaScript already

#229

Earlier quoted context omitted.

Yeah, he did. As a javascript developer I wouldn't limit myself that much though - he considers using ++ a sign of bad code.

To be fair, Crockford gives his reasons [1] and the replacement is literally += 1 instead of ++. Given the very low cost of the change, and that it is an optional rule in jslint, I have no problem with it. [1] See here for more discussion and links to Crockford explaining the reasons: http://stackoverflow.com/questions/971312/why-avoid-incremen...

True, but for me the issue is that with += I have to double check that it is only adding one (and not skipping any) to understand the loop, where as ++ is something I have seen so many times that my brain reads it in a different way.

Re: Enough with the JavaScript already

#230
post #228

Earlier quoted context omitted.

I think a lot of experienced developers are only using the good parts, it's difficult to learn but it can indeed be a very beautiful language when you use it with modules/jsLint/jsHint.

What kind of modules do you mean - there are so many kinds in Javascript?

http://www.adequatelygood.com/JavaScript-Module-Pattern-In-D...
Post reply on HN