4 ms·
I tried switching to (Iced)CoffeeScript to write tests (using Mocha and Sinon) for a Node app (written in JS). It went something like: Week one: this is awesom
by clarkdave 13y ago
I tried switching to (Iced)CoffeeScript to write tests (using Mocha and Sinon) for a Node app (written in JS). It went something like:
Week one: this is awesome. It's so clean!
Week two: asynchronous stuff is still an utter pain though. Hey, what's this IcedCoffeeScript...?
Week three: Wow, ICS is great. My tests look like Ruby & rspec now!
Week four:
ICS produces unholy Javascript and unintelligible stacktraces. I've lost count of how many hours I've lost trying to figure out which line triggered a test to fail. Let's switch back to CoffeeScript and use async.
Week five:
Still fed up not being able to identify which line failed at a glance, and have been bitten more than once by CoffeeScript's indentation causing subtle errors, which is easy to confuse if you do any copypasting within `describe` blocks.
Week six:
I'm just going back to straight JavaScript. It's a pain but it does the job.
I've since given up on being able to write tests in Node.js with the same elegance/ease as I can with Ruby & rspec.
I still dig CoffeeScript, but now I only use it for client-side stuff. And as for IcedCoffeeScript, that has found a place in my toolbelt for small scripts, where its speed to write and lack of noise are worth the trade off in maintainability.