Active Markdown - literate CoffeeScript meets Tangle
github.com4 pointsby alecperkins0 comments
…
{
'id': 123,
'url': '/resource/123'
},
…
instead of …
'/resource/123',
'/resource/124',
…
or worse …
123,
124,
…
Also, Django REST Framework is easily my favorite REST API tool for Django. It's very straightforward to use just as much or just as little of it as necessary. In fact, it's powering the main views of the upcoming second draft of http://marquee.by (the entire site is effectively a browsable API). result = _.map object, (val, key) ->
foo(val)
is much cleaner than var result = _.map(object, function(val, key) {
return foo(val)
});
I think. my_object =
key: 'value'
fn: (response) ->
console.log(response)
to be more clear than my_object = {
key: 'value',
fn: function() {
console.log(response)
}
}
because it doesn't have all the crap. CoffeeScript's whitespace syntax is even more helpful when those objects start getting nested. Plus, not having to deal with trailing commas is amazing. At the same time, someFn arg1, arg2, ->
doStuffInACallback()
, arg3
can be confusing, so parens help: someFn(arg1, arg2, ->
doStuffInACallback()
, arg3)
I try to not be "that guy" when it comes to CoffeeScript, but it's easily one of my favorite languages now. All the crap that JavaScript requires is just gone.
Also, how does the notation feel? The goal is a balance between functional/useful and simplicity. Ideally, the plaintext version is just as understandable.