3 ms·
I wrote the user-interface for my iPad app in JS (using PhoneGap) initially. Working on a large pure JS UI project sure makes you realize the shortcomings of JS
by chime 15y ago
I wrote the user-interface for my iPad app in JS (using PhoneGap) initially. Working on a large pure JS UI project sure makes you realize the shortcomings of JS, both fundamental and syntactic. It took a week to convert the JS to CS by hand and I did it hoping that the one-time effort would pay itself off over the next few months of development. Within just 2 weeks after the conversion, I started cranking out more features than I had in months before, and surprisingly with very little new code being written.
CS enabled me to write cleaner, simpler code in 5 lines instead of 30 lines in JS. While I don't care about the LOC as a metric of performance, I do have a limited short-term memory and can't remember the intricate workings of a class I wrote 2 months ago. Being able to recollect how a class functions is significantly easier if you have to read 50 LOC instead of 300.
I don't understand why people worry about being pro or against a language or a variant. Before CS, I managed to write decent JS that made me productive. With CS, I write better code and am more productive. Hence I continue to use CS. YMMV.
Also it's amusing to see this was posted to HN by jashkenas himself.
- wccrawford 15y agoNit-pick: 2 months is not 'short term memory'. Short term memory is limited to the now. It's limited to things you are actively thinking about. While I haven't used CS for anything professional yet, I've used it for personal projects and it's been pretty nice. Except for the lack of a great reference guide. I've spent more time Googling than I'd like to. But compared to what I'd have had to do in Javascript for the same code... There's no way I'd have used Javascript for a lot of it. CoffeeScript is definitely a competitive language for me.