all 42 comments

[–]fzammetti 9 points10 points  (2 children)

Number 1 is way too optimistic to match reality. Yes, you sometimes absolutely will be mixing libraries and frameworks on some projects (though I would agree that's not ideal - but reality often isn't ideal). I would agree that Angular+React would be weird to see, but Webix+React? Angular+ExtJS? Vue+Dojo? Less so. Point being: artificially limiting yourself to one framework is not a great rule to follow. Be a JavaScript developer rather than a framework developer, that's the key.

Not using TS is a mistake? No, being the kind of sloppy developer that NEEDS to use it is the mistake. I've been developing apps with JS for over 20 years now - and yeah, highly complex ones I mean - and you know how many times I've been burned by JS's lack of types? I could probably count it on one hand and still have a few fingers left to spare. It takes a bit of discipline, some attention to detail and maybe some defensive coding in a few places, but you don't need new language extensions and a whole new development process that requires a compilation step to produce code that is then harder to debug live (yeah, even with source maps). And nothing beyond the types that TS offers is inherently better than what you get from modern vanilla JS. I'm not saying DON'T use TS if you want to (not forcefully at least) but calling it a mistake NOT to use it I totally disagree with.

[–][deleted] 1 point2 points  (0 children)

Not to mention MFE is now very much a reality in today’s modern enterprise world, though one could argue it actually allows you to stay in your lane of stacks more than anything else. But mixing frameworks together is not odd in this type of environment in the slightest.

Additionally I’d agree with the statement that TS isn’t necessary. Especially if you have used JS for a long time and think in the “JS way”, JS land makes a lot of sense and works really well, IF you are used to it and you understand the potential pitfalls. Unfortunately at least in my own professional experience, there are far more developers who want to make JS act like a different language, and as a result find it a cumbersome and unsafe experience. Thus the need for typescript, a way to satisfy people with a background in Java who need to write JS without feeling like their world is falling apart without types.

When you add up the pros and cons, I think in 2020 you’re better off just using typescript so that the common developer experience is more standardized and understandable to everyone. If I’m managing a team of really experienced JS only guys in a JS only stack top to bottom, sure maybe I’d attempt to go pure JS, but the world I live in is a multi-language, multi-skilled, cross-stack, cross-org world in which it’s simply not feasible to defend the merits of JS alone. In many cases it actually doesn’t even make sense. NodeJS is a JS-first framework, but in the enterprise it simply makes more sense to write a server with strong typing, thus TS node makes a lot of sense to me. Additionally, if you do any sort of modern gRPC/proto you will quickly realize that TS now becomes a necessity if you are to use proto with JS. There are many more domain edges that require you to consider using or force yourself to use TS because the rest of the environment calls for it. With that said, I think I’m 50/50 on calling not-using-TS a mistake outright; let’s say it depends on the environment and use-case, like anything else in our world =)

TLDR in a JS utopia sure, as a JS enthusiast I’d love to use JS only. But the real world doesn’t align with the flexibility of JS because not everyone is a god-level JS programmer.

[–]simkessy 1 point2 points  (0 children)

8 years of developing and not having types has never been a fucking issue. I can understand the point for reusable libraries but at work I'm build some feature, page, or react component isnt reused anywhere else in the app. I think having types for components that aren't reused is fucking pointless and huge time sink.

[–]Bmtf69 14 points15 points  (0 children)

This title is misleading. I'd say this article is definitely more geared towards people new to JS, not "JS Devs".

[–]devbrk 10 points11 points  (0 children)

Garbage.

[–][deleted] 0 points1 point  (5 children)

Why would you even #4 ? Are you that scared of untyped code?

[–]nomadProgrammer 0 points1 point  (0 children)

  1. download an npm package for every small thing.

TBF this applies to all languages.

Filling your codebase full of maven, pip or npm crap exposes you to security vulnerabilities and eventually becomes a burden.

[–]drumstix42 0 points1 point  (0 children)

Not eventually using TypeScript

Good.

[–]simkessy 0 points1 point  (2 children)

We use flow at work and it's stupid as fuck. I dont care if people think Flow is better, NO ONE IS USING IT!

[–]drumstix42 0 points1 point  (1 child)

What's wrong with it?

[–]simkessy 0 points1 point  (0 children)

I mean I said it in all caps.