For people who enjoy the controlled flight into terrain that is the modern Javascript ecosystem, here's a "postmortem" on another one-function Javascript "library" like left-pad that broke everyone's build:https://medium.com/@forbeslindesay/is-promise-post-mortem-cab807f18dcc …
-
Show this thread
-
(and if you're curious how absurd this kind of programming has become, here's the entirety of the "library" that you get by depending on is-promise: https://github.com/then/is-promise/blob/master/index.js …)
10 replies 8 retweets 51 likesShow this thread -
Replying to @cmuratori
The key thing you're missing is that lines of code != complexity of problem. This repository frequently gets people submitting changes that they think are perf improvements or simplifications, but that actually introduce bugs.
2 replies 0 retweets 2 likes -
Replying to @ForbesLindesay @cmuratori
It also has a type definition that has gone through 3 iterations to get to the right point. Many developers have contributed to building this into something you can rely on. If you build it yourself, you have to discover all the edge cases yourself.
2 replies 0 retweets 2 likes -
Replying to @ForbesLindesay @cmuratori
It's kind of absurd the amount of effort that goes into static type checking compared to the value of catching the kinds of bugs it can catch.
1 reply 0 retweets 0 likes -
Replying to @DougOrleans @cmuratori
It’s also about productivity, especially when it comes to refactoring and on boarding new team members. The value it pays back in those areas is incalculably huge
2 replies 0 retweets 0 likes -
Replying to @ForbesLindesay @cmuratori
Good test coverage gives the same benefits, plus more...
1 reply 0 retweets 0 likes -
Replying to @DougOrleans @cmuratori
It categorically does not. When I rename a method I get an instant list from TypeScript of every line that breaks. As a new dev I can glance at the header of a fn and see what types it takes and returns without reading the implementation. Tests do neither of these.
1 reply 0 retweets 1 like -
Tests are still super important, but as the saying goes: “write tests, not too many, mostly integration” a lot of unit testing work becomes unnecessary with good strong types
2 replies 0 retweets 0 likes -
It’s also worth noting that most of the benefits only come with a strong type system (TypeScript, Flow, Rust, Haskel) not with weak type systems (Java, C#). I moved to JavaScript largely to get away from weak type systems, but strong type systems are amazing.
1 reply 0 retweets 0 likes
A) Java and C# are strongly typed. B) JavaScript is dynamically typed. I assume you meant TypeScript specifically when you say you "moved to JavaScript to get away from weak type systems"? and C) Unsubscribe
-
-
I think he meant a "strong type system" not "strongly typed" -- C# and Java are lacking a lot of safety compared to Typescript/Haskell/Rust
2 replies 0 retweets 1 like -
Yes, exactly this.
1 reply 0 retweets 0 likes - Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.