Feeds

Dropbox drops JavaScript, brews CoffeeScript

23,000 lines of code converted, but why?

Intelligent flash storage arrays

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

Providing a secure and efficient Helpdesk

More from The Register

next story
Preview redux: Microsoft ships new Windows 10 build with 7,000 changes
Latest bleeding-edge bits borrow Action Center from Windows Phone
Google opens Inbox – email for people too thick to handle email
Print this article out and give it to someone tech-y if you get stuck
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
FTDI yanks chip-bricking driver from Windows Update, vows to fight on
Next driver to battle fake chips with 'non-invasive' methods
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
Entity Framework goes 'code first' as Microsoft pulls visual design tool
Visual Studio database diagramming's out the window
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
prev story

Whitepapers

Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
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.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
New hybrid storage solutions
Tackling data challenges through emerging hybrid storage solutions that enable optimum database performance whilst managing costs and increasingly large data stores.