Live data from Hacker News

For modern development Javascript indeed is a shit language

live.julik.nl

181–190 of 243 posts

Re: For modern development Javascript indeed is a shit language

#181
post #158

Earlier quoted context omitted.

It's still a programmer error when they accidentally call a function with 2 arguments when they meant to call it with 3. The fact that the language can't inform them of the error doesn't change that.

So do some error checks. The first unit test I write for any function is that it handles arguments correctly.

So in every single function, I have to either:

A) Silently ignore errors in param counts, get cryptic bugs later when a trivial merge changes a function signature, or when changing a function signature.

B) Add explicit code to check the parameter counts at a huge cost (a per-function overhead!) along with extra tests for this silly thing for each and every function. This overhead is insane!

I have to choose between cryptic bugs and insane overhead, all for what? So you can use "args" and not "*args"?

This is a catastrophic choice for the language.

Re: For modern development Javascript indeed is a shit language

#182

Earlier quoted context omitted.

> ... in other ways it necessitates more manual checking (or slower debugging). There's no catastrophe, just design differences. See, there's the problem. Glossing over issues by explaining them away as "design differences". Nothing about an expressive language necessitates making life hard for the programmer. If your function call doesn't match the signature then it is very likely to be in error, and instead of fail…

> If your function call doesn't match the signature Depending on what constitutes function signature. I agree with “design difference” argument. Someone has to make design decisions, even if someone else doesn't agree with them.

The problem is the design here is to trade errors that could be detected with cryptic bugs that can slip through. Or alternatively, adding insane per-function overhead/testing to manually cover signature checking.

Re: For modern development Javascript indeed is a shit language

#183

Earlier quoted context omitted.

"My pet is fast because it can beat a turtle and a slug in a race"

Lol. Seriously though, show me a dynamic language (other than Lisp) that's even half as fast as Javascript...

Without Python, Ruby, Javascript and Lisp, we are sort of running out of dinamic languages options..

But the funny thing is the one that got left out, is the one that is faster than Javascript: Lua

Re: For modern development Javascript indeed is a shit language

#184

Here we go again. Let's enumerate the technologies which are shit: HTML is horrible CSS is an abomination HTTP is wasteful, slow and old C++ is a horrible language (Linus Trovalds) C is dangerous Java sucks .. I'll stop there and let you expand the list if you want. Turns out the whole computing world is built on top of this terrible tech which many people hate, yet somehow it's moving forward.

Because concepts from the bleeding edge of language research are slowly trickling down from Haskell & Co. to mainstream languages. Ten years after they emerge.

Re: For modern development Javascript indeed is a shit language

#185
post #180
post #20

Earlier quoted context omitted.

Is this so much of a problem that we need to re-design JS to handle it? Why not just avoid making this mistake in the first place by reading the code? Not to sound dismissive - but if you're making these kinds of mistakes regularly enough to irritate you, it's not the language that's at fault. Javascript's squishiness is the thing I like the most about it. It's far from perfect, just like any other language out there…

> Why not just avoid making this mistake in the first place by reading the code? We're talking about programming errors . Are you suggesting the solution to human error is to just not make errors?? Note, of course, that wrong arguments will frequently not arise from a function call you just wrote -- but from changes in the code. Say you merge in a trivial merge of some code, which changed a function's signature/param…

> We're talking about programming errors. Are you suggesting the solution to human error is to just not make errors??

Not at all, I'm simply suggesting that people take care to acknowledge and operate within the rules of the language. If you're making changes to a function signature in JS without assessing the impact for code elsewhere, then you're doing a bad job - and that's all there is to it. JS allows you to do something which when ignored or fucked up, results in problems. This is not a JSism - this is just the way things work. Every language has 'features' like this. If you don't know what you're doing, then stop doing it. "A bad workman blames his tools" and all that jazz.

> Note, of course, that wrong arguments will frequently not arise from a function call you just wrote -- but from changes in the code.

So JS has a (potentially) higher maintenance cost. This doesn't mean that JS is badly designed - it's just a trade-off. Some people don't care, others do. Clearly to some people, it's an unacceptable cost - but all that means is that those people have a lower tolerance for that kind of thing than others.

> Say you merge in a trivial merge of some code, which changed a function's signature/parameters. The merge succeeds trivially. Now every single function call is a bug that is not only uncaught by a compiler. It won't even necessarily be caught at runtime. Instead, it may escalate to catastrophic, undefined/unexpected behavior.

This is just a case for good documentation and release notes. Don't merge in changes that you don't understand.

Re: For modern development Javascript indeed is a shit language

#186

Earlier quoted context omitted.

Firefox Nightly [1,10,5,-15,-2,4].sort ((a, b) => a-b).toString(); "-15,-2,1,4,5,10"

You have responded to my pointing out that '->' syntax doesn't work in current browsers with an example of a different bit of syntax, '=>', that works in a single development browser. I don't follow your point.

Sorry you asked for an example which works in a Javascript console, I gave one, if you were trying to make a snarky reply about the state of es6 support in modern browsers then I misread it.

Re: For modern development Javascript indeed is a shit language

#187

Earlier quoted context omitted.

You have responded to my pointing out that '->' syntax doesn't work in current browsers with an example of a different bit of syntax, '=>', that works in a single development browser. I don't follow your point.

Sorry you asked for an example which works in a Javascript console, I gave one, if you were trying to make a snarky reply about the state of es6 support in modern browsers then I misread it.

Actually when I posted it I was honestly unaware if that was ES6 Javascript or just Coffescript or something. People seem to throw them all about interchangeably which is very confusing to people like me who don't follow Javascript development.

Re: For modern development Javascript indeed is a shit language

#188

Despite most of the points in this post being debatable — there's one bit that caught my eye: "Being nice will not help it, and CoffeeScript is not radical enough." As the guy who started CoffeeScript, I agree. It's an intentionally very conservative approach. But there's more than one good way to skin the JavaScript cat. I think it would be fun to take another run at the same problem — attempt to find a minimal, rea…

I have no idea why, but CoffeeScript gives me a "kid on Christmas" feeling when I code in it. I never realized how much mental load went into counting braces and curly brackets, how many times I've tried randomly copy-pasting a variable assignment into different parts of a script until I stopped getting an error, etc. This weekend, I decided to pick up Node, and, to kill 2 birds with one stone, I've been rewriting ev…

I very much agree. Now, I only touch raw JavaScript when I absolutely have to.

Re: For modern development Javascript indeed is a shit language

#189

Earlier quoted context omitted.

Lol. Seriously though, show me a dynamic language (other than Lisp) that's even half as fast as Javascript...

Without Python, Ruby, Javascript and Lisp, we are sort of running out of dinamic languages options.. But the funny thing is the one that got left out, is the one that is faster than Javascript: Lua

Is it really faster than Javascript though?

http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...

Re: For modern development Javascript indeed is a shit language

#190
post #65

Earlier quoted context omitted.

> I've been playing around with it a bit... Tell us more!

I'm afraid that there's not much to show yet, apart from some little prototype scribblings, and the basic idea: The web that we build for today is a rich, almost entirely backwards-compatible stew of nearly two decades of browser development and standards work, resulting in a triumvirate of very different languages that need to come together in order to make a web application happen: HTML + CSS + JS. Two of them are…

How do you feel about CoffeeCup + (CCSS or AbsurdJS)? Not unified enough?
Post reply on HN