
Ask HN: I hate JavaScript - saltcookie
But i wana make a webapp, how should i go about building a web app without touching javascript, is there any frameworks like gwt for golang, or C++, rust
======
jaxbot
I get why people hate it, and your opinion is fine. But you're going to have a
rough time building a web app if you hate JavaScript, even if you use a
language that compiles down to it.

JavaScript is at the heart of web apps, where DOM, CSS, and logic are married.
Sure, you can bypass it using server side scripting or languages that convert
to JS, but in the end, you're trying to sew a dress using only hotglue. It'll
work, but it's the wrong tool for the job, and it'll lead you down a road of
pain and headaches.

I'd recommend collaborating with someone who knows JavaScript well, then you
can focus on backend logic and collaborate on other pieces.

------
krapp
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...](http://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockford/dp/0596517742) \- 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.)_

------
smoyer
I'd recommend using Errai
([http://erraiframework.org/](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).

------
angersock
You can't even spell correctly--no wonder you hate Javascript.

It's a fairly small language and if you refer to simple best practices (as
outlined in, say, _Javascript: The Good Parts_ ) you won't have a bad time at
all.

It's the first language to introduce closures to the masses, the only language
that is really _at home_ in an HTML document (some newcomers aside), and on
the server it's quite easy to quickly bash something together in Node.

Blindly declaring that you hate the _lingua franca_ of webapps is pretty
difficult road to hoe. What's your issue?

------
mindcrime
_But i wana make a webapp, how should i go about building a web app without
touching javascript_

Use Java.

[http://pivot.apache.org](http://pivot.apache.org)

Demos, no javascript required.

[http://pivot.apache.org/demos/](http://pivot.apache.org/demos/)

Deploy as applet or via JWS.

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

~~~
AlexeyBrin
> 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 :).

------
dustin1114
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.

~~~
saltcookie
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

~~~
angersock
It is a poor workman who blames his tools.

~~~
LBarret
works both ways : a good workman choose good tools.

------
27182818284
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.

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

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

------
yunyeng
You can easily create a web app with PHP-HTML but your app will never be
successful without Javascript! Most of the people was not aware of its
awesomeness until few years ago, now there are millions of frameworks,
scripts, server side, back-end,front-end all kind of things created in
Javascript. I think its the language of tomorrow.

------
daviding
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?

~~~
saltcookie
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

~~~
stakent
'use strict'; will help you a little with javascript.

[https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Strict_mode)

------
AlexeyBrin
You can compile C++ to JS using Emscripten, but I doubt you will be able to do
webdev this way ...

For building webapps try CoffeeScript (inspired from Ruby and Python, compiles
to JavaScript), Dart (seems to be inspired from Java, compiles to JavaScript),
ClojureScript (a Lisp language, compiled to JavaScript) ...

------
muyuu
[https://www.dartlang.org/](https://www.dartlang.org/) seems like the obvious
answer but you'll still need to learn another language.

------
anonfunction
If you're more inclined to go down a functional route then you may find elm to
be particularly exciting:

[http://elm-lang.org/](http://elm-lang.org/)

------
vatotemking
#firstworldproblems. seriously though you can try
[http://www.typescriptlang.org/](http://www.typescriptlang.org/)

------
mischief6
[https://github.com/gopherjs/gopherjs](https://github.com/gopherjs/gopherjs)

------
__xtrimsky
Everyone hates it at first. Just learn it raw, learn jQuery, learn Javascript
OOP.

You will get used to it. (and maybe like it at the end)

------
elwell
Just use CoffeeScript. Or, ClojureScript if you want to drink the functional
kool-aid.

------
bricss
Please, just don't make any web app's at all.

------
rdtsc
Give Dart a try

~~~
fithisux
Dart is better.

