[nodejs] Re: javascript vision thing

# kai zhu (6 years ago)

yes, in order of severity:

  1. es6 generators and modules are the top 2 notorious things that come to mind as being difficult to debug/integrate in product-development.

  2. classes (and typescript, though not directly es6-related), tend to create lots of unnecessary structure that becomes a PITA when you need to rewrite everything, which occurs often in product-development. there are lots of newly minted js-devs entering industry, who lack experience in understanding the risks of javascript over-engineering (and that nothing you write is permanent). they write lots of semi-permanent, es6 infrastructure-code during the initial design-phase, which is a general no-no for many veterans, who understand most of that stuff is going to get tossed out the window and rewritten during integration-phase (and again everytime a ux feature-request comes in that breaks the existing integration-workflow).

  3. let and const declarations. most code you debug/write in javascript is ux-related integration-code dealing with async-io, which relies heavily on function-scoped closures to pass variables across process-ticks. block-level scoping is an unnecessary design-pattern that leads to confusion over the former.

  4. fat-arrow. it has garden-path issues, making it difficult to write efficient javascript-parsers that can differentiate the following [valid] javascript-code:

(aa = 1, bb = 2, cc = 3);
// vs
(aa = 1, bb = 2, cc = 3) => aa + bb;

this leads to fundamental performance-issues with tooling/minification/test-coverage-instrumenters. jslint for efficiency-reasons, simply cheats and assumes both of the above are fat-arrows, and raises fat-arrow warnings for both (and halts further parsing) [1].

[1] jslint managing garden-path complexity of fat-arrow, with a single lookahead, that can turn out wrong, so it halts parsing. douglascrockford/JSLint/blob/36adbc73ef0275df7d3fac9c3ef0844ac506136b/jslint.js#L2914, douglascrockford/JSLint/blob/36adbc73ef0275df7d3fac9c3ef0844ac506136b/jslint.js#L2914

kai zhu kaizhu256 at gmail.com

# kai zhu (6 years ago)

this is not a troll-account, and I’m a live-person with realistic (albeit uncomfortable) views on limitations of javascript product-development in industry.

es6 seems to adopt java’s philosophy that with careful-planning, you can create semi-permanent, well-abstracted code during the design-phase that will last throughout the product-development cycle. my experience with numerous web-projects, both successful and failed, indicates this approach as flawed. and i believe most people in industry who have been burned by failed web-projects in the past (due to over-encumbered/engineered initial-designs that couldn’t cope with realities of product integration/qa) are wary of hiring unproven java-turned-js devs who still hold these brittle design-philosophies.

there's no such thing as “permanent” javascript-code in product-development. everything eventually gets rewritten, when the inevitable business-critical ux feature-request comes in that you must accommodate, even though it breaks your current integration-workflow. when this common scenario plays out in industry:

a) the [inexperienced] unqualified js-dev likely dithers, unwilling/unable to unwind the complicated initial-design they architected to accommodate the feature-request, while b) the [experienced] qualified js-dev would have anticipated this, and simply rewrites their initial expendable-code with new expendable-code to accommodate the feature-request (with expectation it will be rewritten again-and-again in the future).

its difficult for employers to discern whether js-devs will exhibit trait a) or trait b) through technical-interview alone. and es6 skews this with design-patterns biased towards trait a), further confusing employers seeking qualified js-devs.

kai zhu kaizhu256 at gmail.com

# Henrique Barcelos (6 years ago)
  1. es6 generators and modules are the top 2 notorious things that come to

mind as being difficult to debug/integrate in product-development.

How exactly are generators and modules difficult to integrate or debug? Difficult compared to what?

How are ES modules more complicated for the developer than CommonJS or UMD?

How come generators be more complex than handling a sequence of asynchronous code using a user-land event-based API?

How difficult would it be for Javascript engines to optimize user-land code?

  1. classes (and typescript, though not directly es6-related), tend to

create lots of unnecessary structure that becomes a PITA when you need to rewrite everything, which occurs often in product-development. there are lots of newly minted js-devs entering industry, who lack experience in understanding the risks of javascript over-engineering (and that nothing you write is permanent). they write lots of semi-permanent, es6 infrastructure-code during the initial design-phase, which is a general no-no for many veterans, who understand most of that stuff is going to get tossed out the window and rewritten during integration-phase (and again everytime a ux feature-request comes in that breaks the existing integration-workflow).

What exactly is this related to classes? While I myself am not a fan of the whole classical syntactic sugar on top of prototypal chains, it's not the language's fault that its features are frequently abused and misused.

What you're saying about over-engineering is not intrinsic to the Javascript community, it's a software engineering problem.

Maybe it's because we work in a new field, with roughly 50 years (although programming itself has changed a lot since the 60's). Maybe it's because we're forming bad developers. Maybe it's because software development is a really complex subject.

One thing we can know for sure is that the tools are not the problem. We are. You can use a knife to cook a delicious meal, by you can also use it to kill someone.

  1. let and const declarations. most code you debug/write in javascript is

ux-related integration-code dealing with async-io, which relies heavily on function-scoped closures to pass variables across process-ticks. block-level scoping is an unnecessary design-pattern that leads to confusion over the former.

This is an odd complaint, because variable hoisting was one of the more convoluted features of Javascript, simply because it was different from any other language I've heard of.

I don't think you could even call block-level scoping a "design pattern", because it is a de facto standard for modern languages.

Em sáb, 22 de set de 2018 04:42, kai zhu <kaizhu256 at gmail.com> escreveu:

# Naveen Chawla (6 years ago)

ES6 doesn't encourage any design patterns. All it does is allow you to shorten existing constructs into simpler-to-program ones, and simpler-to-understand ones. I want TC39 to continue in this vein, making big things easier to accomplish with less, hence, speeding up development time (very important) and reducing the surface area for potential bugs (also very important). And, I want them to be very aggressive (fast) in this regard

# Henrique Barcelos (6 years ago)
  1. es6 generators and modules are the top 2 notorious things that come to

mind as being difficult to debug/integrate in product-development.

How exactly are generators and modules difficult to integrate or debug? Difficult compared to what?

How are ES modules more complicated for the developer than CommonJS or UMD?

How come generators be more complex than handling a sequence of asynchronous code using a user-land event-based API?

How difficult would it be for Javascript engines to optimize user-land code?

To me, it's far better to have something in the language's standard lib that a user-land implementation, specially for beginners.

  1. classes (and typescript, though not directly es6-related), tend to

create lots of unnecessary structure that becomes a PITA when you need to rewrite everything, which occurs often in product-development. there are lots of newly minted js-devs entering industry, who lack experience in understanding the risks of javascript over-engineering (and that nothing you write is permanent). they write lots of semi-permanent, es6 infrastructure-code during the initial design-phase, which is a general no-no for many veterans, who understand most of that stuff is going to get tossed out the window and rewritten during integration-phase (and again everytime a ux feature-request comes in that breaks the existing integration-workflow).

What exactly is this related to classes? While I myself am not a fan of the whole classical syntactic sugar on top of prototypal chains, it's not the language's fault that its features are frequently abused and misused.

What you're saying about over-engineering is not intrinsic to the Javascript community, it's a software engineering problem.

Maybe it's because we work in a new field, with roughly 50 years (although programming itself has changed a lot since the 60's). Maybe it's because we're forming bad developers. Maybe it's because software development is a really complex subject.

One thing we can know for sure is that the tools are not the problem. We are. You can use a knife to cook a delicious meal, by you can also use it to kill someone.

  1. let and const declarations. most code you debug/write in javascript is

ux-related integration-code dealing with async-io, which relies heavily on function-scoped closures to pass variables across process-ticks. block-level scoping is an unnecessary design-pattern that leads to confusion over the former.

This is an odd complaint, because variable hoisting was one of the more convoluted features of Javascript, simply because it was different from any other language I've heard of.

I don't think you could even call block-level scoping a "design pattern", because it is a de facto standard for modern languages.

  1. fat-arrow. it has garden-path issues, making it difficult to write

efficient javascript-parsers that can differentiate the following [valid] javascript-code:

(aa = 1, bb = 2, cc = 3); // vs (aa = 1, bb = 2, cc = 3) => aa + bb;

>this leads to fundamental performance-issues with

tooling/minification/test-coverage-instrumenters. jslint for
efficiency-reasons, simply cheats and assumes both of the above are
fat-arrows, and raises fat-arrow warnings for both (and halts further
parsing) [1].

I have never written or seen code like `(aa = 1, bb = 2, cc = 3)`. If you
code like that, you're the problem, not JavaScript. Even though it's a
valid construct, for compatibility sake, it doesn't mean that modern tools
should support or endorse this.

"Oh, but performance...". Yeah, you can also write a perfectly valid code
that hurts performance as well. You can even create an infinite loop with
valid constructs. It doesn't mean you should.

---

Summarizing what I'm trying to say: your criticism has nothing to do with
the language or its evolution pace. They are universal problems around
software engineering and will continue to be even if we slowed down.

I've been writing Javascript code since ES3 and my life got significantly
better with ES6+.

The existence of TC39 guarantees that a feature will only make it into the
language after a very thorough public scrutiny process.

I don't believe we need to go slower. In fact, I wish we could move even
faster.


Em dom, 23 de set de 2018 01:32, Henrique Barcelos <
rick.hjpbarcelos at gmail.com> escreveu:
# Ben Wiley (6 years ago)

I find the general tone of the preceding thread condescending toward developers who have dealt with real problems recent ES additions have addressed. Though I don't think I totally follow your argument that continuing to increase API surface area decreases the surface area for bugs. Perhaps for the developer, but certainly not for the core platform which browsers have to implement. Also as there's a trend toward demand for more and more language-inherent ways to accomplish the same thing, I think we're beginning to overload newcomers to the language with grammar to learn.

Ben

Le dim. 23 sept. 2018 00 h 51, Henrique Barcelos <rick.hjpbarcelos at gmail.com>

a écrit :

# Isiah Meadows (6 years ago)

(Not TC39 or a list admin, so please don't take this as authoritative by any means. These are all my personal opinions and mine only.)

To add onto this, could you all maybe take the complaints and general software discussion to Reddit, Twitter, private emails, or elsewhere? Philosophizing about JS is on-topic, but picking apart JS features to trash without adequate explanation isn't exactly philosophizing, and general language-independent complaints about the software industry are pretty off-topic when they have little-to-nothing to do with JS, and I'm not exactly seeing much connecting them to JS in some of these emails.

I've lately been observing more than actually discussing, but after being subscribed for about 3-4 years alternating between observing and actually contributing to this mailing list, I'd rather not have to unsubscribe because people persistently generating unproductive/off-topic content. This isn't even the first thread I've noted having these kinds of issues - a series of proposals about a few months ago made by someone trying to turn JS into a haphazard form of Prolog were no better than this, and I've seen quite a few other proposals here since that were also under-investigated before being proposed here. I've seen a few semi-recent gems come from here, such as with pattern matching and the using statement, but these seem to me to be becoming fewer and farther between, becoming the exception, not the norm.

I really don't like the direction this mailing list is going, and I hope it some day gets better. But my hopes for this happening are fading quickly, and much of this thread really isn't helping. I see a lot of condescension and animosity from multiple authors (not naming names), both towards each other and towards other developers in general. Could we please do without that?

Sorry for the long-winded rant.

# T.J. Crowder (6 years ago)

I agree with Isiah. (And like Isiah, I'm just this guy, you know? Not TC39 or anything.)

In particular, the constant re-litigating of decided issues, rehashing the same data-free assertions almost every time anything is suggested to move forward, seems flatly off-topic for the list to me, and I'm a bit surprised that a list admin hasn't dealt with it yet. It's been allowed to go on for far too long. As always, constructive input on something being proposed is great. Constantly banging on that everything since ES5 made life worse is just noise (and would be even if it were true).

-- T.J. Crowder