Live data from Hacker News

Ask HN: I hate JavaScript

news.ycombinator.com

11–20 of 33 posts

Re: Ask HN: I hate JavaScript

#11
You could try CoffeeScript. It takes away a lot of what people don't like about JavaScript out, and replaces it with a decent syntax. I personally love well written vanilla JavaScript, but CoffeeScript might give you a little better experience if you "hate" JS.

So, is it the DOM you don't like, or the actual JS syntax and structure? For me, when I overcame the weakness of the DOM API, and utilized it elegently, I started to enjoy JS.

Re: Ask HN: I hate JavaScript

#13
I'd recommend using Errai (http://erraiframework.org/) ... you get to program in a well-known, type-safe language and much of the JavaEE infrastructure is extended into the browser. Errai is based on GWT but allows the use of HTML as the templating language (instead of UiBinder which is GWT's XML-based templating function).

One great thing about both Errai and GWT projects is that they're optimized for many browsers and the compiler abstracts away the differences between browsers (by compiling a version of the application for each).

Re: Ask HN: I hate JavaScript

#14
post #3

What do you hate about it? My biggest transition to being comfortable with it was to find a happy place in terms of editing. After years of C/C++ it was not easy to be picking fragments of code out of DOM bellyfluff lint. So how do you use javascript dev tools and what don't you like about them I guess?

just a week ago, i made a test for myself, i decided to write merge sort in golang and javascript.

My golang program was complete in like 10min, but javascript program took 2 hrs. I dont know if its just me, but i tend to make small errors while programing, like making sure a variable is not undefined and stuff. Even though my logic was perfect its just very difficult to debug algorithms in javascript, let alone any lint for ide thats reliable.

the golang compiler is really good at catching errors, and makes programing more fun for me atleaset

Re: Ask HN: I hate JavaScript

#15
You may have to learn to put up with it. It's not the end of the world. It's just a scripting language, just suck it up and deal.

There are any number of js frameworks which will probably abstract away most of the headaches you might have, and depending on what you're actually trying to accomplish, you may not need a lot of js at all. If you don't want to use client-side templating, for instance, and there's no reason to, then just skip it. Push as much of it to the backend in the language of your choice as you can.

But javascript, when you need scripting in the browser, is kind of unavoidable.

Also consider http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor... - your expectations from working with other languages may be getting in the way of your writing javascript properly and effectively.

(or do what a lot of other people do and work with a language that compiles to js and you can pretend you live in an alternate universe where you're not working with javascript even though you really are.)

Re: Ask HN: I hate JavaScript

#16

You could try CoffeeScript. It takes away a lot of what people don't like about JavaScript out, and replaces it with a decent syntax. I personally love well written vanilla JavaScript, but CoffeeScript might give you a little better experience if you "hate" JS. So, is it the DOM you don't like, or the actual JS syntax and structure? For me, when I overcame the weakness of the DOM API, and utilized it elegently, I sta…

its just javascript, its so error prone, it can take hella long to write simple algorithms, because of some undefined error.

compare that to golang, even though u make errors, the compiler is so awesome at pointing those out. And u can get so much done

Re: Ask HN: I hate JavaScript

#18

There are lots of languages nicer than JS that compile down to JS. That said, you don't need JS to make a webapp. You can do it strictly with server-side code and HTML.

i read about a project that converts llvm byte code to javascript, do any of u know about it

Yes, Emscripten, basically takes C or C++ and compiles to JavaScript using LLVM.

Re: Ask HN: I hate JavaScript

#19

We all hate it but can't get away from it.

> We all hate it but can't get away from it.

Gratuitous generalization, because you hate it, doesn't mean everybody hates JavaScript. The problem is that most people that hate JavaScript don't bother to properly learn the language because of the familiar syntax and they get burned by it :).

Post reply on HN