# Single-line comments
##
Multi-line comments
##
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
function makeStubbedDescriptor(component, props, contextStubs) { | |
var TestWrapper = React.createClass({ | |
childContextTypes: { | |
currentPath: React.PropTypes.string, | |
makePath: React.PropTypes.func.isRequired, | |
makeHref: React.PropTypes.func.isRequired, | |
transitionTo: React.PropTypes.func.isRequired, | |
replaceWith: React.PropTypes.func.isRequired, | |
goBack: React.PropTypes.func.isRequired, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clone(object) { | |
var cloned = Object.create(object.prototype || null); | |
Object.keys(object).map(function (i) { | |
cloned[i] = object[i]; | |
}); | |
return cloned; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS Bin</title> | |
<style> | |
</style> | |
</head> | |
<body> | |
<p id="sending">Sending mail...</p> | |
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> |
#Why I Don't Use CoffeeScript
CoffeeScript in of itself, and not as a transpiled language, is slick. The problem for me is what it's supposedly "fixing".
##Syntax Sugar
For a Rails and Python developer JS is ugly (as I hear). You have... dun dun dun, curly brackets and white space doesn't mean anything (oh the humanity!). But, I like my whitespace. I like not being restricted on how I write my code aesthetically. Not to mention CoffeeScript is by far less human readable than JavaScript. Programming languages, IMO, need to be a good balance of both human and machine readable. Simple example:
cube = (x) -> square(x) * x