alecperkins | 13 years ago | on: Active Markdown: an experiment
alecperkins's comments
alecperkins | 13 years ago | on: Thalmic (YC W13) introduces gesture control without the cameras
Said researchers now have a company, Oblong industries, that's basically making the Minority Report interface a reality: http://oblong.com/
alecperkins | 13 years ago | on: Stop Using Small Font Sizes
alecperkins | 13 years ago | on: Try RethinkDB in your browser
alecperkins | 13 years ago | on: BBC demands DRM for HTML5
alecperkins | 13 years ago | on: In Defense of "The Big Bang Theory"
As for Sheldon generally being a douchebag, the article does a good job of explaining his (partially deserved) sense of superiority.
alecperkins | 13 years ago | on: Youth expelled from Montreal college after finding security flaw
alecperkins | 13 years ago | on: The Atlantic posts sponsored Scientology story, moderates comments
alecperkins | 13 years ago | on: Json ⊄ js
alecperkins | 13 years ago | on: Single-Click Double-Tap Murder
alecperkins | 13 years ago | on: Snow Fall: The Avalanche at Tunnel Creek
alecperkins | 13 years ago | on: Hypermedia APIs on Rails
So,
…
{
'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).alecperkins | 13 years ago | on: Apple Could Power the Web
This article is severely undermined by its conflating internet and web. Objective-C doesn't have a significant presence in the browser, and is consequently a useless language for achieving a monolingual web stack. The article demonstrates a complete lack of awareness of the frontend side of the web and assumes that iOS apps are this frontend. There is not a single mention of JavaScript, or even the word "browser".
It also seems to be overly focused on the idea of computational performance, when in many cases applications are IO-bound. The descending cost of compute power means this efficiency edge in computation is decreasing in importance. Also, no mention of things like PyPy? Overall, the article has a very narrow-minded and misguided view of the web.
alecperkins | 13 years ago | on: Student Suspended for Refusing to Wear a School-Issued RFID Tracker
alecperkins | 13 years ago | on: Reddit user captures video of 2012 voting machines altering votes
alecperkins | 13 years ago | on: Introducing the Redesigned Bitbucket
alecperkins | 13 years ago | on: CoffeeScript: less typing, bad readability
Readability is very subjective and depends on the user's knowledge of the language, as well as personal style, or 'accent', if you will. Code written with, for example, leading commas in dictionaries instead of trailing commas just looks bizarre to me and is a little harder to read, to me, even though I like to do something similar and stack colons.
alecperkins | 13 years ago | on: CoffeeScript: less typing, bad readability
alecperkins | 13 years ago | on: CoffeeScript: less typing, bad readability
result = _.map object, (val, key) ->
foo(val)
is much cleaner than var result = _.map(object, function(val, key) {
return foo(val)
});
I think.alecperkins | 13 years ago | on: CoffeeScript: less typing, bad readability
Many of the issues raised in this article can be solved by "simply" not doing it (admittedly not always a real solution). Just because the language allows something to be done, doesn't mean it should be done that way. Our team has a styleguide that clearly explains good and bad practice, for CoffeeScript AND Python. (It's possible to do bonkers stuff in Python, too, just harder.) It includes things like: use explicit returns, especially when intending to return nothing; include parenthesis unless it's more clear without them (callback as arguments).
Yes, it'd be great if the language were more explicit and made it harder to do confusing thing. But, its core goal is being "just javascript", which prevents some of that explicitness. Also, the flexibility lets the real goal be clarity.
I find
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.