other-languages

here be heresies and things we have to use for work
sveri 2016-06-17T09:29:54.000004Z

Is there any tool for javascript that keeps human beings sane? For instance one that hints me that this code

"use strict";
function foo(b) {
    console.log(b);
}
foo(3, 4);
calls foo with the wrong number of arguments? I know about typescript and cljs obviously, but I wonder if something for pure javascript exists?

borkdude 2016-06-17T09:32:33.000005Z

@sveri: the arguments declared says nothing about the amount of arguments you can pass to a function in javascript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments/length

sveri 2016-06-17T09:42:58.000007Z

@borkdude: is it really that bad?

borkdude 2016-06-17T09:45:30.000008Z

@sveri: it's a design choice (which I don't understand)

sveri 2016-06-17T09:50:35.000009Z

Funny that there is also Function.length which holds the number of parameters the functions expects

sveri 2016-06-17T09:51:14.000010Z

still that would leave place to a linter that checks if these two things match

borkdude 2016-06-17T12:05:17.000011Z

@sveri I'm doing some CoffeeScript atm. In my opinion this language is even worse than JavaScript.

👍 2
sveri 2016-06-17T12:05:40.000012Z

worse? is that possible?

borkdude 2016-06-17T12:06:10.000013Z

it depends on how you look at it

seancorfield 2016-06-17T15:57:51.000014Z

We had a contractor build us some "JS" stuff and they used CoffeeScript. Told us "It's way better than JS!". Having tried to maintain it for a while, we do not agree!!!

tjg 2016-06-17T18:15:00.000015Z

Interesting, might be nice for me to google for Coffeescript critiques.

tjg 2016-06-17T18:15:00.000016Z

A while ago, I convinced a (fairly hostile) team to consense on allowing Coffeescript in a Node.js project. (Naturally, I emphasized disadvantages to balance my advocacy.)

tjg 2016-06-17T18:15:05.000017Z

Significantly reduced boilerplate of classes & nested callbacks. Though the way it represented datastructures was a step backwards IIRC. (Or was I able to use Javascript notation then for this?) Liked expressing in Coffeescript by default, but Javascript when better.

tjg 2016-06-17T18:21:49.000019Z

One advantage is it was fairly simple to convert Coffeescript <-> Javascript, IIRC. (With reasonable amounts of manual polishing.)