Feeds

Dropbox drops JavaScript, brews CoffeeScript

23,000 lines of code converted, but why?

Boost IT visibility and business value

Dropbox has stopped using JavaScript whenever it codes for browsers and has instead adopted CoffeeScript by re-writing 23,000 lines of code.

DropBox developers Dan W, Ziga M and Chris V explain their choice in a blog post, offering brevity of syntax as their main concern and citing the following statistics from the company's re-coding project as evidence of CoffeeScript's lesser burden for developers.

JavaScript CoffeeScript
Lines of code 23437 18417
Tokens 75334 66058
Characters 865613 659930

That 5000 fewer lines of code, the developers write, “is beneficial for simple reasons — being able to fit more code into a single editor screen, for example.”

“Measuring reduction in code complexity is of course much harder,” the coders add, “but we think the stats above, especially token count, are a good first-order approximation.”

Astute Reg readers may, at this point, wonder why it makes sense to bother replacing 23,000 lines of code when CoffeeScript compiles down into JavaScript anyway.

Indeed, while the developers feel more productive, there's no indication the site works better after the transition to the new scripting language. “The size of the compressed bundle didn’t change significantly pre- and post-coffee transformation, so our users shouldn’t notice anything different,” the trio write. “The site performs and behaves as before.”

The developers are Python-lovers, and that language is a source of inspiration for CoffeeScript's creators. The move to CoffeeScript therefore offered the chance to code in a more Python-like environment, something that's tough to do given JavaScript's slow evolution. The fact that the re-coding process took place during a week-long hackathon is another clue to the project's motivation.

There's nothing new, of course, about software re-platforming projects. Here in El Reg's antipodean eyrie we've covered (in past lives) a few aimed at extending the life of applications written in legacy languages. Those projects, however, had a commercial outcome as their rationale. It's unclear if that's the case here. ®

Boost IT visibility and business value

More from The Register

next story
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
Leaked Windows Phone 8.1 Update specs tease details of Nokia's next mobes
New screen sizes, dual SIMs, voice over LTE, and more
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
Mozilla keeps its Beard, hopes anti-gay marriage troubles are now over
Plenty on new CEO's todo list – starting with Firefox's slipping grasp
Apple: We'll unleash OS X Yosemite beta on the MASSES on 24 July
Starting today, regular fanbois will be guinea pigs, it tells Reg
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Cloudy CoreOS Linux distro declares itself production-ready
Lightweight, container-happy Linux gets first Stable release
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Backing up Big Data
Solving backup challenges and “protect everything from everywhere,” as we move into the era of big data management and the adoption of BYOD.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Why and how to choose the right cloud vendor
The benefits of cloud-based storage in your processes. Eliminate onsite, disk-based backup and archiving in favor of cloud-based data protection.