3 ms·
Ask HN: Why are some of the older developers afraid of javascript?
They do everything in their power to avoid using it. It seems like they missed the memo, and still think majority of the population doesn't use javascript enabled browsers?
- noodle 18y agoa lot of older developers still view javascript as the unstable, insecure language. as an example, steve gibson (of grc.com) won't use it, iirc. and they're right, really. you can't put bulky business logic in javascript if you have any need for security.
- deleted 18y ago[deleted]
- icey 18y agoIf I had to guess, it'd probably be roughly related to things like this: var x = 1; var y = 1; function methodA() { return { javascript: x + y }; } function methodB() { return{ javascript: x + y }; } (Hint: They don't do the same thing)
- spoiledtechie 18y agoAnswer?
- deleted 18y ago[deleted]
- icey 18y agomethodA returns "undefined", methodB returns an object.
- jacquesm 18y agothat's just scary. I had to go and try it just because I could not believe it, now can anybody explain to me why there is a difference here ?
- icey 18y agoIt's because of semicolon insertion. Ostensibly, this was added to the language to make it more user friendly. Instead, it's the source of a lot of bugs. Here is a decent overview: http://www.openjs.com/articles/semicolon_insertion.php http://www.openjs.com/articles/semicolon_insertion.php
- jacquesm 18y agoWhat were they smoking ? I though the auto-correcting language interpreter/compiler went out the window with Pascal, there were some pretty good reasons for it and 'automatic bug insertion' was the main one. This ought to be deprecated and exterminated.
- lacker 18y agoThe fundamental problem with javascript is that it is not simple to deprecate features and add new ones. Any javascript you write has to work on at least several IE and Firefox versions, and there is no solution for this on the horizon, besides perhaps compilers that emit javascript.
- teej 18y agoHere's another gem. Compare: (0.1 + 0.2) * 10 (1 + 2)
- sharkbrainguy 18y agowhoah... what? surely ... but ... >> (0.1+ 0.2) * 10 3.0000000000000004 >> (0.1 + 0.2 + 0.1) * 10 4 wtf is going on here? Where you would expect 0.3 you just always seem to get 0.3000000000000004 ... but then it "corrects" ... Haunted!
- sharkbrainguy 18y agoso ... it turns out that this is just a property of floating point math... weird that I've never seen that before. It behaves the same in Python and MzScheme, so I can't imagine that this is something "keeping people away" from javascript.
- joe_bleau 18y agoI only turn javascript on when I need it for a site that I trust (easy with Opera). If I forget and leave it on, it seems like far too many sites bog down my machine with crappy eye-candy and advertising. (Maybe I won't care so much when/if I upgrade to a faster PC.) I find it terribly annoying when a site requires javascript, but doesn't do anything compelling with it. For instance, why on earth does this page require javascript to be on, just to show me a .jpg map? http://www.arkansashighways.com/Road/mapopt.htm http://www.arkansashighways.com/Road/mapopt.htm
- amichail 18y agoI would not use javascript much in the same way as I would not use assembler. But using javascript as the target of a more stable platform with extensive tool support (e.g., Java with GWT) is fine.
- RobGR 18y agoI don't write javascript, because I don't run javascript (with a few exceptions). I associate javascript with crap websites. It is slow and it causes the browser to use up a lot of memory. The functionality gained by it is usually pointless fru-fru, the doilies and tailfins of the internet. I fully realize that to some people those doilies and tailfins are very important, but perhaps I can achieve my business goals by selling things to other people. The notion of writing a program to run on someone's desktop is reasonable; the notion of writing a program to run on my server, but send it's display information out to a browser, is also reasonable. The idea of having most of a program be on my server, but some random chunks be on the user's computer, seems like a bad split. I realize that in some cases such as input data validation it can remove a browser-server round trip, and in some cases it might be an over all win; but as a general rule it's a bad idea. There is an idea that you can avoid the load of running everything on your server, but also avoid the problems of writing client programs for all the variations of operating systems, by writing code that runs in some wrapper, usually associated with the browser. These attempts - flash, java applets, javascript, active X objects, etc - are all bad ideas. I realize that the majority of the population uses javascript enabled browsers. I didn't "miss the memo", I was there when the memo came out: I remember attending free lectures given by Sun Java evangelists when Java was first released, in fact I still have a free coffee mug with "headstart java" or something on it around here. I got excited, did the "hello world" app and then a calculator, and then suddenly had to disable java applets to keep the ads from crapping up my browser. Javascript came after that, then flash, now it looks like Microsoft is pushing this silverlight thing which sounds like v5.0 of the same bad idea. Now, just so I don't totally seem like an old grouch, here's some constructive advice: write your web app so it's interface is all very standard, very minimal html. Then, write an iPhone program that does the client-side stuff you think is so great. If you are still in business after that, take the iPhone app and make it into an OSX desktop program and announce your iPhone app is now available on the desktop. Presuming your idea is not the friendster or geocities of it's age and already dead, and presuming that people find these client-side features appealing enough to download and install something, then move on to making your desktop client work on other platforms. Do not take the shortcut of presuming that the browser is an appropriate platform.
- lacker 18y ago