Feeds

Dropbox drops JavaScript, brews CoffeeScript

23,000 lines of code converted, but why?

3 Big data security analytics techniques

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

Top three mobile application threats

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Inside the Hekaton: SQL Server 2014's database engine deconstructed
Nadella's database sqares the circle of cheap memory vs speed
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
OpenSSL Heartbleed: Bloody nose for open-source bleeding hearts
Bloke behind the cockup says not enough people are helping crucial crypto project
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
prev story

Whitepapers

Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Five 3D headsets to be won!
We were so impressed by the Durovis Dive headset we’ve asked the company to give some away to Reg readers.
SANS - Survey on application security programs
In this whitepaper learn about the state of application security programs and practices of 488 surveyed respondents, and discover how mature and effective these programs are.