Hacker News new | ask | show | jobs
by slackingoff2017 3242 days ago
Typescript with TsLint is a godsend on larger codebases. It makes JavaScript into a pretty solid language for big projects.

Without it you frequently run into objects passed to you after going through 10k lines of code and it becomes a wicked game to figure out which properties the object actually has at that point.

JavaScript, even ES6, is IMO crap for large codebases.

Does this object have the property I'm looking for? Did somebody overwrite it with the wrong type 5000 lines ago? Why is the prototype chain broken? Where's my damn inline documentation.

My company has abandoned JavaScript wholesale with great relief. If it was a physical object we would have tossed it off the balcony.

2 comments

Typescript is essential for large codebases / many devs.

> My company has abandoned JavaScript wholesale with great relief. If it was a physical object we would have tossed it off the balcony.

I would like to do the same with our gigantic SPA-ghetti.

There's no time like the present to start! Typescript's allowJS compiler option and comment-based approach lets you start with the spaghetti you have and slowly transition to Typescript.

(Though I'm still fan of the "rip off the Band-Aid" approach I used in a few projects back in the day: rename every .js to .ts and then fix compiler errors until things compile. allowJS is a great option now.)

The true source of your problems there are mutation, which in my opinion is the primary source of issues. Immutable data structures being the most benefit.

I also believe dynamic language tooling has regressed.

> I also believe dynamic language tooling has regressed.

I'd truthfully love to hear more about that. Care to elaborate?

I've worked with common lisp, clojure, python and javascript, and common lisp debuggers are just hands down better in everyway. Check this series for what should be a basic debugging experience by now http://malisper.me/debugging-lisp-part-1-recompilation/