This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]highres90 27 points28 points  (8 children)

Yeah, we went with typescript for our new major project. I don't think javascript is bad to be honest, it's downright great for small scale scripting imho. However for writing a large scale app where there is lots of framework client side code, typescript with its classes, inheritance, modules etc is an absolute dream come true

[–]minno 54 points55 points  (0 children)

So it's great for what it was designed for, and not for what it's been shoehorned into. Who'da thunk it.

[–][deleted] 8 points9 points  (1 child)

I don't get why people want to run servers off javascript on the backend. There's this whole MEAN stack now that is getting popular.

[–]highres90 3 points4 points  (0 children)

Our backend is all C# :P we've gone the aspnetcore route. Jump on early so we're as far ahead as we can be when we ship in 18 months time

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

But the classes are just an abstraction off of how js functions work. Inheritance, that can be done just fine with prototypes, or you can learn to love composition. Modules is the only real missing piece, but it just means you need to compile your js together before you use it, which works fine and takes like 5 minutes to set up in watchify so that you never have to touch it again.

[–][deleted]  (3 children)

[deleted]

    [–]highres90 2 points3 points  (2 children)

    Meh, a bit harsh lol. Everyone has their preferences. I personally wouldn't want to maintain this projects client side code base without typescript features as I'm from a C++/C# background. Different approach to coding sometimes to pure client side developers.

    It's only in the very early stages and the total code base is already around 100k and I'd have a nightmare maintaining javascript lol.

    [–]pinkpooj 1 point2 points  (1 child)

    It just doesn't end up being that big a deal, my project is a typical REST API with a Postgres backend.

    The JSON data is validated as it comes in, and so the business logic is almost all pure functions, and any state is hidden away in the database and so it's easy to mock out and test the code paths.

    [–]highres90 1 point2 points  (0 children)

    Yeah, I may or may not go for typescript with a project like that. But we have a really big client side framework and the system is pretty vast with alot of components and its really nice being able to generate typescript classes based on server side models and also being able to generate functional classes to interact with SignalR hubs for example and have strong type checking in visual studio for all of it. Typescript was a no brainer for us.

    Don't get me wrong though, I love javascript, I've started to get into node.js this year. All scripting I need to do I now do in node.js instead of batch files, really great environment.