this post was submitted on 14 Nov 2023
813 points (94.7% liked)

Programmer Humor

32192 readers
489 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 7 points 10 months ago (1 children)

This is more a condemnation of nest.js than ts. It seems great in theory. I like the architecture and the ability to share models and interfaces between front and backend, but it's objectively makes everything more complicated. It adds layers of abstraction that should not be necessary and it's such a niche/unpopular framework for backend systems that you generally have to jump through hoops to do anything moderately complex. Not only do new devs have to learn typescript to use it, they have to learn the nest architecture to know how to do things "the right way" and you still end up in situations like this which looks perfectly valid but isn't. Typescript was never meant to be used for backend, and trying to make it do so and then complaining about it is like jogging while carrying a gun, shooting yourself in the foot, and blaming the gun.

[โ€“] [email protected] 1 points 10 months ago

the ability to share models and interfaces between front and backend

On the other hand, this can be considered a downside because it locks you into using JS/TS on the front and backends.

Alternatively, if you define your models and interface with an Open API spec, you can write the front and backends in whatever language you want.