Feeds

Dropbox drops JavaScript, brews CoffeeScript

23,000 lines of code converted, but why?

Providing a secure and efficient Helpdesk

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. ®

Choosing a cloud hosting partner with confidence

More from The Register

next story
Microsoft WINDOWS 10: Seven ATE Nine. Or Eight did really
Windows NEIN skipped, tech preview due out on Wednesday
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
'Google is NOT the gatekeeper to the web, as some claim'
Plus: 'Pretty sure iOS 8.0.2 will just turn the iPhone into a fax machine'
prev story

Whitepapers

A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.