Fork me on GitHub
#off-topic
<
2017-09-09
>
tagore03:09:11

@fellshard I am confuse son

fellshard03:09:38

tl;dr major parse ambiguity between 'object literal' and 'function block'

fellshard03:09:56

And they opted to resolve that ambiguity by defaulting to 'function block'

fellshard03:09:21

When the rest of the language spins on the assumption that object literals can be sprinkled liberally

fellshard03:09:57

Seeing something like {x: 1}, I assume object literal, not function block-label-value-return undefined.

fellshard03:09:13

Inconsistent design leading to intuition being broken.

tagore03:09:35

Hmm.. I guess I program very defensively in JS.

tagore03:09:55

Which is not necessarily a good thing.

tagore03:09:13

But yeah, there is ambiguity in bracing, and you just have to know that to use ES6...

tagore03:09:31

If that were the least of my problems with JS I'd count myself lucky.

tagore03:09:14

I write a lot of unbraced arrow functions (I'd say that something like 80% of the code I write is basically unbraced arrow functions, and I'm trying to get better) and while it bites me occasionally it's easy to catch.

tagore03:09:05

There are many other and better reasons to avoid js.

fellshard05:09:42

I wish I could avoid it right now šŸ˜ž

fellshard05:09:12

Every year, JS: "How can we implement useful features in the most inconvenient way possible?"

fellshard05:09:28

Though, tbf, Java has a similar track record

tagore15:09:14

@fellshard Yeah, I feel that way a lot myself šŸ˜‰

tagore15:09:55

I think it's possible to write pretty reasonable JS- there's actually a kind of acceptable, if inferior, Lisp in there if you cut away as many of the unfortunate bits as possible (though there are fundamental aspects of underlying semantics that are just irreparably broken, IMHO.)

hmaurer13:09:01

Writing reasonable JS is actually what drove me to Clojure. While I do agree itā€™s possible to write JS in a functional style (not to equate ā€œreasonableā€ with ā€œfunctionalā€, butā€¦), the syntax (and inextensibility) does make it difficult/verbose.

hmaurer13:09:50

In my case, I ended up writing a lot of my code with Ramda (a FP library in JS), and found myself driving further and further away from ā€œidiomatic JSā€

hmaurer13:09:14

My code was still javascript, but I was using Ramda absolutely everywhere to manipulate immutable data

hmaurer13:09:16

and it was quite verbose

hmaurer13:09:21

At that point you start to doubt the benefits of writing javascript. The argument that another javascript dev could pick up your code doesnā€™t hold anymore

hmaurer14:09:11

Now of course thatā€™s an extreme case

hmaurer14:09:02

But if you do want your code to be fully functional, immutable, etc, I feel the learning curve of doing it in javascript is similar to learning Clojurescript, and will lead to much worse code

tagore15:09:29

And I'd prefer even an inferior and somewhat broken Lisp to Java, tbh.

tagore15:09:37

I don't hate writing fresh Javascript. But I often work on a codebase that is a few years old and probably approaching 200k lines of JS, much of it written by people who clearly did not know how to write decent JS. I do kind of hate maintaining that code.

hmaurer13:09:39

Donā€™t we all šŸ˜ž