3 ms·
Oh dear. First of all - shipping binary code to browsers. Please. No. Flash is bad enough. Say good bye to all the grease monkey style hacks and remixes and lo
by junklight 16y ago
Oh dear.
First of all - shipping binary code to browsers. Please. No. Flash is bad enough. Say good bye to all the grease monkey style hacks and remixes and lots of other interesting things about the web.
Secondly - either you are a programmer or not. I can't actually tell from your article if you want to be or not. However if you want to be a good programmer then you need to learn other languages - you might not be an expert in those other languages but being able to navigate your way round them - it is good for your programmers brain. Eric Raymonds famous article actually recommends you should try and learn a new language every year http://www.catb.org/esr/faqs/hacker-howto.html http://www.catb.org/esr/faqs/hacker-howto.html
And thirdly - Javascript is actually a real cool language masquerading as a very dull mainstream one. I resisted doing too much in it for years but as I needed to do more and more
I found out that its very powerful and flexible. Also if you use something like jquery you get a lot of Ruby style bits and pieces.
And lastly - it might be a cliche but that doesn't mean its not true (to use another cliche in defence of the one I am about to use) - If all you have is a hammer then every thing looks like a nail. Ruby might be a pretty good language - but there is a reason there are so many other languages and its not because all the other people are idiots who weren't smart enough to come up with Ruby.
- pedrocr 16y ago>First of all - shipping binary code to browsers. Please. No. Flash is bad enough. Say good bye to all the grease monkey style hacks and remixes and lots of other interesting things about the web. Monkey patching bytecode may very well be harder but is that really used? Greasemonkey is marginal at best. What other things do you have in mind? >Secondly - either you are a programmer or not. I can't actually tell from your article if you want to be or not. However if you want to be a good programmer then you need to learn other languages - you might not be an expert in those other languages but being able to navigate your way round them - it is good for your programmers brain. I've learned plenty of languages and do appreciate some of the points of Javascript. I just don't see why everyone seems to defend it as the one-true-language for the client side. For everything else people make plenty of diverse choices yet somehow on the one platform that for historical reasons is stuck with a single language saying you'd rather use another implies somehow that you don't get it. >And thirdly - Javascript is actually a real cool language masquerading as a very dull mainstream one. I resisted doing too much in it for years but as I needed to do more and more I found out that its very powerful and flexible. Also if you use something like jquery you get a lot of Ruby style bits and pieces. I am using jQuery and it does have some goodies. The point isn't that with effort I couldn't make myself more comfortable with it. The point is that I don't see much that Javascript gives me that Ruby doesn't. So the fact I am forced to use Javascript is a net-negative for me. >If all you have is a hammer then every thing looks like a nail. Ruby might be a pretty good language - but there is a reason there are so many other languages and its not because all the other people are idiots who weren't smart enough to come up with Ruby. Certainly. And I do use other languages. The reason I'd like to be able to use Ruby for both codebases is that that would allow me to do interesting stuff I can't right now. In fact the same criticism can be made of Javascript, that because it's the only hammer available everything looks like a nail. I'm proposing more languages, not less.
- junklight 16y agoThat most of the web (and obviously Flash is the exception to this) is text based is not an accident. Browsers and people are not the only thing reading the web - there are crawlers and other tools doing this, that and the other. Search engine crawlers for example go into the javascript and extract links. Also I really don't think you have thought it through as a developer - its bad enough debugging stuff in browser without it being compiled and only having basically machine code to look at. I don't think its the one true language for anyone to be honest - but expecting the browser to ship with several languages in it doesn't appeal to anyone either (and I know you just want a few byte code runtimes in but I cannot see how that would work while still maintaining all the richness and complexity of the web as it stands) anyway - I think if there was any appetite to do anything about this problem it would have been done by now. There were people grumbling about it 10 years ago and I've seen a number of projects to add languages come and go.
- pedrocr 16y ago> That most of the web (and obviously Flash is the exception to this) is text based is not an accident. Browsers and people are not the only thing reading the web - there are crawlers and other tools doing this, that and the other. Search engine crawlers for example go into the javascript and extract links. I can see how that is important for the strings in the code but I'm not aware of many use cases for crawling the actual javascript code. >Also I really don't think you have thought it through as a developer - its bad enough debugging stuff in browser without it being compiled and only having basically machine code to look at. If I want to debug javascript I need Firebug or Chrome's tools and those can very well have support for a standard debugger. >but expecting the browser to ship with several languages in it doesn't appeal to anyone either (and I know you just want a few byte code runtimes I just want one standard bytecode runtime. I can ship and have the user cache whatever runtime I need. > but I cannot see how that would work while still maintaining all the richness and complexity of the web as it stands) I still don't see what web richness is there to be had inside the <script> tag. Seems to me all the uses of it that aren't simply execution are marginal at best. >anyway - I think if there was any appetite to do anything about this problem it would have been done by now. There were people grumbling about it 10 years ago and I've seen a number of projects to add languages come and go. It seems to have been enough of a problem for google to have built GWT. I wonder why they haven't shipped a Dalvik VM in Chrome and have their GWT apps target the VM on Android and Chrome and Javascript for everyone else. Is V8 execution these days comparable to a good JVM/CLR?
- tzs 16y ago"First of all - shipping binary code to browsers. Please. No. Flash is bad enough. Say good bye to all the grease monkey style hacks and remixes and lots of other interesting things about the web" I don't see how browsers interpreting compiled bytecode would prevent greasemonkey-style hacks.
- bad_user 16y agoshipping binary code to browsers He's not talking about binary code. He's talking about bytecode with the same security restrictions Javascript has, with the only difference being that a bytecode language is optimized for being a target of compilers, otherwise you have to be Google to make a functional compiler targeting Javascript. Flash is bad enough He's not talking about Java Applets or Flash either, he's talking about shipping a bytecode interpreter/compiler instead of a Javascript interpreter/compiler. if you want to be a good programmer then you need to learn other languages I'm increasingly frustrated by having to learn programming languages, not for productivity, not because I'm learning useful new things, but because a certain platform requires it. Eric Raymonds famous article actually recommends you should try and learn a new language every year I would take Eric's advice with a grain of salt: far more useful is to learn new algorithms, data structures, some design skills or do some math learning / exercises every year. Or how about sharping those marketing skills by reading some books / travelling / investing in some offshore relationships? Learning a language that's similar to what you already know is a waist of time. And if you properly learn C++, Haskell and Lisp you're pretty much done with everything there is to know about programming languages. Javascript is actually a real cool language masquerading as a very dull mainstream one IMHO, programming languages cannot be separated from their mainstream implementation, as many people seem to suggest. No matter how cool Javascript is, you're going to feel the pain related to browser issues. If all you have is a hammer then every thing looks like a nail Except that most programming languages are hammers of various sizes with a steeper learning curve than a library that could give you the same productivity. Case in point for Java programmers: http://www.playframework.org/ http://www.playframework.org/
- junklight 16y agoI'm afraid all this seems like pedantic nit-picking to me - attacking the letter of what I said rather than what I was trying to say. However I did want to comment on my favourite line in this: " if you properly learn C++, Haskell and Lisp " Yes. If you properly learn them I would fully agree. I have in my time made my living as both a C++ programmer and a Lisp programmer and was pretty good at both - but not even close to having properly learned either. Learning them properly would be a life times experience and I suspect you would be a pretty decent programmer at the end of it.
- user24 16y agoI think this is an important question to ask. I don't think the OP is asking it for quite the right reasons, but I still think it's important. As web developers, we're all about 'openness', 'choice' and other warm fuzzy concepts. So why is it OK that JavaScript is the only client side option? the script element has 'language' and 'type' attributes, clearly indicating the possibility of other types of script (indeed, microsoft used to support VBScript in web pages, don't know if they still do). To address some of your points: 1) Implementation isn't important. Sure, don't ship binaries to browsers. That's just a detail, the main point is why can't we ship anything other than JS? 3) JS is a cool language. So what? JPG is a cool format, doesn't mean there's no room for PNG too. 4) If all you have is JavaScript then everything looks like a JS problem.