News for hackers. Stuff that matters.
Re:Node.js adds experimental support for TypeScript by gaptoothclan on Thursday July 25, 2024 @05:05AM (#41066463)
A long time ago I started converted to using node js for backend work, seemed to offer many benefits over writing code in PHP without bringing many problems of Java. I found node to be somewhat clunky and a language where you had to bolt it together to get the language you wanted. Eventually started writing golang and it felt much easier to write, sometimes way more verbose but the type safety just made coding simpler.

Typescript seemed like a good option but was just another bolt on, I am not sure what value you gain by using Typescript over Golang, you have nice defined types which is great but it does not solve other issues with the language that are resolved in golang (also solved in deno).

One large benefit of using node over golang is the speed of prototyping something which I think having to use type script largely negates, so I can not really decide if this is a good step forwards or is making node loose some qualities that made it a good choice in other ways.

Re:Node.js adds experimental support for TypeScript by bezier-curve on Thursday July 25, 2024 @05:27AM (#41066604)
Typescript is safer JS. You're still using JS with TS. The "bolted on" phrasing makes me think your issue may be more the absence of more opinionated frameworks like Django, that manage everything out of the box. I love using Django, but it's a little harder to go off the beaten path with it.
Re:Node.js adds experimental support for TypeScript by gaptoothclan on Thursday July 25, 2024 @05:32AM (#41066637)
My phrasing there was a direct comparison of developer experience between golang and nodejs. Golang has a very complete core library, I try to avoid frameworks as much as possible. For me I rarely have to think about the language or ecosystem, everything I want or need is already part of the language, testing, linting are some great examples
Re:Node.js adds experimental support for TypeScript by hot_gril on Thursday July 25, 2024 @11:59AM (#41070177)
"Bolted on" is how I'd describe it too. Using TS means messing a lot more with random config files. And standard tools like the NodeJS profiler don't work with TS, which hopefully will change soon.

I've never used Django. Express seems a lot nicer.

Re:Node.js adds experimental support for TypeScript by _joel on Thursday July 25, 2024 @05:11AM (#41066503)
I guess if you already know Javascript, or have inhouse experience vs. learning Go. We use it with cdktf as previous fe experience, seemed logical vs. Go
Re:Node.js adds experimental support for TypeScript by gaptoothclan on Thursday July 25, 2024 @05:24AM (#41066585)
sorry was going to add that there are probably more javascript developers in the jobs market, although there is a limit to the usefulness of these developers.

In the company I worked at we were fairly small and did not have huge applications running on node, so it made that journey easier

Re:Node.js adds experimental support for TypeScript by __alias on Thursday July 25, 2024 @05:14AM (#41066529)
I mean the obvious answer is language familiarity, If your projects frontend code is in javascript/typescript ( which it is ), then using node is an easy choice. Shared libraries, shared types, etc etc
Re:Node.js adds experimental support for TypeScript by gaptoothclan on Thursday July 25, 2024 @05:28AM (#41066611)
I was in the paradigm, there was very little code reuse from front to backend, some time performing validation I would like to have that option, but I would not have that as a killer feature that determined the language I use.
Re:Node.js adds experimental support for TypeScript by fulafel on Thursday July 25, 2024 @05:20AM (#41066560)
Lots of people do of course use other languages for the frontend. (Or go for thin frontends, ala HTMX )
Re:Node.js adds experimental support for TypeScript by __alias on Friday August 02, 2024 @05:08AM (#41137228)
1. that's a lie, and "lots" of people don't use HTMX (unless I've been living under a rock and there is a non-unsubstantial number of people using it :D ) 2. HTMX IS javascript, and you can still use the same familiar packages across front end and backend e.g. lodash