DEV Community

Discussion on: Is javascript or typescript the best for backend development?

Collapse
 
hitochan777 profile image
hitochan

Thanks! I'm sorry I think my explanation was unclear.
What I meant is not the difference between javascript and typescript, but
javascript(or typescript) vs other languages (e.g. Golang, Python...).

Collapse
 
lucretius profile image
Robert Lippens

I love JavaScript but having worked almost exclusively on backends written in Node for the past half a year - I am missing static typed languages a lot. While some may find it takes longer to get a project going in a statically typed language vs something dynamic, I've found that the iteration cycles are nice and quick in a statically typed language where the compiler can bark at you, your IDE can be sure about the hints it gives you, etc. whereas with something like JavaScript, my code can look fine, but I forgot about this one instance where I get some undefined property which screws up some nested query I'm making. And I won't find out about it until I run the project and hit that particular use case. IDEs have gotten much better about interpreting JavaScript, but I still run into the lovely "undefined is not a function", or "cannot read property of undefined". Compiled languages allow you to be sure of these classes of errors.

There are tradeoffs of course, but I like the safety of static typing in something like Go for a backend.