News for hackers. Stuff that matters.
Re:JavaScript libraries should be written in TypeScript by jfe on Wednesday March 16, 2016 @12:27PM (#11298536)
In my limited experience working with JavaScript, I've found the lack of the following to cause more problems when writing modular, reusable code than the lack of type annotations:

* a single, definitive method for creating namespaces without using a framework or library

* a single, definitive method for defining classes and using inheritance without using a framework or library

* a single, definitive method of allowing async functions to modify the state of an object without having to declare that object in the global scope, without using a framework or library

If these problems are already solved, please let me know!

Re:JavaScript libraries should be written in TypeScript by Mchl on Wednesday March 16, 2016 @12:32PM (#11298592)
The one about classes is solved by not using classes. Prototypal inheritance works well (and besides, most implementations of 'class-like' behaviour are using prototypes underneath anyway)

I'm playing a bit of a devil's advocate here ;)

Re:JavaScript libraries should be written in TypeScript by tlrobinson on Wednesday March 16, 2016 @12:40PM (#11298643)
ES6 provides solutions for #1 and #2. These will replace the fragmented existing solutions.

I'm not sure I understand #3. Closures?

1. https://babeljs.io/docs/learn-es2015/#modules

2. https://babeljs.io/docs/learn-es2015/#classes