CoffeeScript: Difference between revisions

Content deleted Content added
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 18 templates: del empty params (12×); hyphenate params (2×);
Monkbot (talk | contribs)
m Task 18 (cosmetic): eval 18 templates: hyphenate params (8×);
Line 8:
| latest_release_version = 2.5.1
| latest_release_date = {{start date and age|2020|01|31|df=yes}}<ref>{{Cite web|url=https://github.com/jashkenas/coffeescript/releases|title=GitHub - jashkenas/coffeescript: Unfancy JavaScript.|date=October 27, 2019|via=GitHub}}</ref>
| influenced_by = [[Haskell (programming language)|Haskell]], [[JavaScript]], [[Perl]],{{citation needed|date=January 2016}} [[Python (programming language)|Python]],<ref>https://coffeescript.org/ "CoffeeScript borrows chained comparisons from Python"</ref> [[Ruby (programming language)|Ruby]], [[YAML]]<ref name="smell">{{cite news |last1=Heller |first1=Martin |date=2011-10-18 |df=dmy |url=https://www.infoworld.com/article/2078452/turn-up-your-nose-at-dart-and-smell-the-coffeescript.html |title=Turn up your nose at Dart and smell the CoffeeScript |work=[[InfoWorld]] |accessdateaccess-date=2020-07-15}}</ref>
| influenced = MoonScript, [[LiveScript]], JavaScript
| operating_system = [[Cross-platform]]
Line 133:
</syntaxhighlight>
 
Ruby-style string interpolation is included in CoffeeScript. Double-quoted strings allow for interpolated values, using #{ ... }, and single-quoted strings are literal.<ref>{{cite web|title=Official CoffeeScript Page|url=http://coffeescript.org|accessdateaccess-date=20 November 2013}}</ref>
 
<syntaxhighlight lang="coffeescript">
Line 146:
|url=http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/
|title=The Problem with Implicit Scoping in CoffeeScript
|accessdateaccess-date=2018-10-13
}}</ref><ref>{{cite web
|url=https://donatstudios.com/CoffeeScript-Madness
|title=CoffeeScript's Scoping is Madness
|accessdateaccess-date=2018-10-13
}}</ref> In particular, it completely disallows [[variable shadowing]] which makes reasoning about code more difficult and
error-prone in some basic programming patterns established
Line 178:
The CoffeeScript compiler has been [[self-hosting (compilers)|self-hosting]] since version 0.5 and is available as a [[Node.js]] utility; however, the core compiler does not rely on Node.js and can be run in any [[JavaScript]] environment.<ref>[https://jashkenas.github.com/coffee-script/#installation CoffeeScript] {{webarchive|url=https://web.archive.org/web/20120427060308/http://jashkenas.github.com/coffee-script/ |date=2012-04-27 }}. Jashkenas.github.com. Retrieved on 2013-07-21.</ref> One alternative to the [[Node.js]] utility is the Coffee Maven Plugin, a plugin for the [[Apache Maven]] build system. The plugin uses the [[Rhino (JavaScript engine)|Rhino]] JavaScript engine written in [[Java (programming language)|Java]].{{citation needed|date=May 2019}}
 
The official site at CoffeeScript.org has a "Try CoffeeScript" button in the menu bar; clicking it opens a modal window in which users can enter CoffeeScript, see the JavaScript output, and run it directly in the browser. The js2coffee<ref>{{cite web |url=http://js2.coffee |title=js2coffee|last=Sta Cruz|first= Rico|accessdateaccess-date=11 May 2014}}</ref> site provides bi-directional translation.
 
== Latest additions ==
Line 188:
 
== Adoption ==
On September 13, 2012, [[Dropbox (service)|Dropbox]] announced that their browser-side code base has been rewritten from [[JavaScript]] to CoffeeScript,<ref>{{cite web|url=https://tech.dropbox.com/?p=361| title=Dropbox dives into CoffeeScript| date=13 September 2012|last= Wheeler| first=Dan| last2= Mahkovec|first2= Ziga |last3= Varenhorst |first3=Chris|accessdateaccess-date=11 May 2013}}</ref> however it has been migrated to [[TypeScript]] in 2017.<ref>{{cite web |last1=Goldstein |first1=David |title=The Great CoffeeScript to Typescript Migration of 2017 |url=https://dropbox.tech/frontend/the-great-coffeescript-to-typescript-migration-of-2017 |website=Dropbox.Tech |accessdateaccess-date=30 June 2020 |date=13 May 2020}}</ref>
 
[[GitHub]]'s internal style guide once said "write new JS in CoffeeScript", and while it no longer does, all the advice in the style guide references how to write good CoffeeScript,<ref>{{cite web|url=https://github.com/styleguide/javascript|title=JavaScript · Styleguide · GitHub|publisher=Github.com|accessdateaccess-date=2015-11-30|archive-url=https://web.archive.org/web/20130815075924/https://github.com/styleguide/javascript|archive-date=2013-08-15|url-status=dead}}</ref> and their [[Atom (text editor)|Atom text editor]] is also written in the language.<ref>[https://github.com/atom/atom Atom source code]. github.com. Retrieved on 2015-07-22.</ref>
 
== See also ==