3 ms·
The amount of koolaid around TypeScript is really something
by dreyfan 5y ago
The amount of koolaid around TypeScript is really something
- toastercat 5y agoPro-tip: skip using TypeScript the lang, and use it instead as a static type checker. Define all your types via JSDoc, and write JS normally: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html https://www.typescriptlang.org/docs/handbook/jsdoc-supported... You miss any potential build step slogs.
- zkldi 5y agoGenuine question: what's up with it? Typed Javascript for me personally has been a godsend for maintenance and avoiding stupid bugs.
- vesuvianvenus 5y agoI haven't had trouble with maintenance or avoiding bugs with NodeJS. I don't see justification for putting in 30-40% more time and effort for the same result. To me it seems like an intentional complication of something which can otherwise be simple. Which is unfortunately somewhat common in this industry of software engineering. It seems there might even be an interest for engineers to keep things complicated-- to gatekeep the industry, to make themselves seem more skilled/necessary so as to keep a job for longer. (more time in a project => more money by the hour. More LoC looks like more work was done... even if the same can be accomplished with 60-70% of the code (i.e. without the type system)).
- gherkinnn 5y ago> I don't see justification for putting in 30-40% more time and effort for the same result. Precisely why I refuse to use JS for any piece of work >500loc.
- jahewson 5y agoIf you work by yourself this can be true. But it’s not that different from saying you don’t need to write tests because you don’t have trouble with bugs! That might be true but it doesn’t make it a good idea. I’ve worked with NodeJS for over 10 years now and have ported many codebases from JS to TS and have never found one that didn’t contain a bug that the TS compiler found immediately, even my own carefully crafted solo projects. Plus every type definition and annotation is basically a free self-maintaining unit test!
- lawwantsin17 5y agoYeah, apparently you NEED it or you'll never maintain anything ever again!
- vesuvianvenus 5y agoI agree. It's so weird to me that a developer would choose to write 30-40% more code than necessary. I love the simplicity of NodeJS/Javacript itself. Plus, there's the fact that TypeScript is developed, owned, and maintained by Microsoft. Look into their 3 E's campaign: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis... and we see it in action-- Here's an example. Terraform CDK [1] -- It offers TypeScript as a language, but not NodeJS. Huh. That's puzzling. I wonder if Microsoft funds the project and requested it to prioritize TypeScript over NodeJS. Additionally, in March 2020, Microsoft purchased npm. I am saddened to see Microsoft moving into a position of control & domination in the Javascript/NodeJS ecosystem. [1] https://github.com/hashicorp/terraform-cdk https://github.com/hashicorp/terraform-cdk
- dzonga 5y agono lies, told: I like this quote from SparkJava > Lately, a lot of server-side web development has been taken over by NodeJS, but a growing number of NodeJS developers are using TypeScript and other statically typed languages that compile to JavaScript. Why not go all the way and use a language that was actually designed with types, and intended to run on the server-side? You also get all the benefits of running your application on the JVM, where libraries aren’t deprecated every day. If you’re coming from ExpressJS, then Spark’s syntax will feel very familiar, and unlike a lot of JavaScript web frameworks, Spark won’t be deprecated tomorrow. as someone who has experience with ExpressJS I agree massively. Typescript you end up fighting the tooling most of the time, rather than getting work done. To avoid all this complexity, server side render pages in html - scalable to infinity. then sprinkle js using script tags n tools like Mithril, Vue, Knockout etc on pages needed.
- fullstackchris 5y agoI agree. While TypeScript is good for any JavaScript project, Node based APIs have always felt like the tooling has lagged behind other frameworks and languages. I've since really started to enjoy .NET for backend tasks - but of course there are many other good options.
- SavantIdiot 5y agoReally? Why do you say that? I use it extensively in large Electron apps. It's saved me from myself so many times and it makes JS so much more structured. I dunno, I think it adds things javascript missed because it was never intended to be such a significant language: it was designed for handling buttons and submitting forms, but it is so much more important than that today. It's the hands-down best cross-platform language in existence.
- deleted 5y ago[deleted]