2 ms·
If JS/CS typing is an issue for you, you may want to take a look at CoffeeScript Contracts, a fork of CoffeeScript that implements contracts: http://disnetdev.c
by jnbiche 15y ago
If JS/CS typing is an issue for you, you may want to take a look at CoffeeScript Contracts, a fork of CoffeeScript that implements contracts: http://disnetdev.com/contracts.coffee/ http://disnetdev.com/contracts.coffee/
I've not used them in production yet but it looks like a very cool way to ensure code quality. The syntax of the Contracts resembles Haskell type definitions. Contracts are very flexible -- for example, you could create and enforce a "Prime Number" type (or whatever type you wish).
Also, you don't have to include the contracts in your production code -- you can compile to JS for production and omit the contracts once you've validated the code against them.
Actually, the more I look at this, the more I think I'll use it for my next CoffeeScript project.