[annotator-dev] Moving away from CoffeeScript

Nick Stenning nick at whiteink.com
Mon Oct 6 20:56:01 UTC 2014


Hi all,

As discussed on our community call today[1] and previously on this
mailing list[2], we often receive requests for Annotator to be a
JavaScript-only project, and to get rid of CoffeeScript.

Every time this has been raised, both in person and online, opinions
seem to me to have been divided into two camps:

1) Yes please, CoffeeScript is a significant barrier/source of friction
for me.
2) CoffeeScript isn't that bad really.

My personal view is that CoffeeScript served a useful purpose in
2010[3], when tooling for JavaScript was poor, and it was all too easy
to write code that blew up in one browser or another. Back then,
CoffeeScript provided a reliable compile step that eliminated these
inconsistencies, and came with a simpler syntax as well.

Now, most of these arguments have lost their potency in the light of
new, better static analysis and code quality tools for JavaScript[4][5].
While it's true that CoffeeScript still provides a less noisy syntax for
writing JavaScript, there are other times when it seems downright
ugly[6][7]. In general, I find that JavaScript is often explicit where
CoffeeScript is implicit, and while this is probably a matter of taste,
my taste leans strongly towards the former[8].

In summary, I don't feel that whatever slight advantage CoffeeScript may
convey outweighs two major issues:

- its role, perceived or real, as a barrier to contribution
- the vastly improved tooling[4][5][9][10] in the JavaScript world

As such, here's a pull request on Annotator that translates the bulk of
the code to JavaScript -- it wasn't more than a few hours work. The rest
of the code (and tests) will follow in due course:

    https://github.com/openannotation/annotator/pull/447

If you feel there are sides to this issue I haven't considered, please
either reply on the list or let me know on the above PR.

Best,
Nick

[1]:
https://hackpad.com/Annotator-Community-Call-October-2014-HwJgWtL6yF5
[2]: http://thread.gmane.org/gmane.comp.web.annotator/74
[3]: https://github.com/openannotation/annotator/commit/b008db8
[4]: http://www.jshint.com/docs/
[5]: https://www.npmjs.org/package/jscs
[6]:
https://stackoverflow.com/questions/6459630/how-to-write-settimeout-with-params-by-coffeescript
[7]:
https://github.com/openannotation/annotator/commit/1fc7024e1a00207c3c4c13ce941622b476dabb51
[8]: http://legacy.python.org/dev/peps/pep-0020/
[9]: http://usejsdoc.org/
[10]: http://blanketjs.org/



More information about the annotator-dev mailing list