Recent News
I wrote a very thorough comment in response to the rather (unfortunately) ignorant and inflammatory blog post on DailyJS titled Static Site Generators for Yeoman, but it seems to have mysteriously disappeared. I didn’t intentionally delete it, at least.
Either way, here’s my original comment, in case you may have missed it.
“If you’re gonna hate, hate with some consistency.” (source)
Earlier today, one of my coworkers was contributing to a cool new JavaScript lib, and complained that while he loves contributing to open source projects (who doesn’t, right?) he finds it annoying to read JavaScript code without semicolons.
Not just that, but he mentioned that he finds it amusing when, amidst hundreds of lines of otherwise pristine semicolon-less code, there is a single line that starts with a semicolon.
So I tweeted about it, then someone tweeted back and I decided to work up an example.
Then I decided to write a blog post. Although that’s mostly because I have a lot of work to do, and I’m an expert procrastinator.
Unless you've used another functional programming language such as ML or Haskell, concepts such as partial application and currying in JavaScript may be foreign to you. That being said, once you understand these concepts, you can put them to use in your own code.
Recently, Miller Medeiros wrote a blog post called Node.js, Ant, Grunt and other build tools where he outlined some of his concerns about JavaScript build tools, focusing specifically on grunt, the task-based JavaScript build tool I’ve been developing.
Instead of posting a super-long comment on his blog, I figured I’d respond to his comments here.
You know the new Apple Retina MacBook Pro laptop? The one with the super-high resolution display? Well, I got one last week, and I spent all weekend updating my dotfiles to work with OS X 10.8 (Mountain Lion). And after a lot of wrangling with XCode, I finally managed to get everything working. Well, almost everything.
While using Gyazo, I’ve encountered one particularly annoying “Retina” related issue. I posted an article a few years ago about running Gyazo on your own server, and ever since then I’ve been running Gyazo without a problem. The first time I used it on the new laptop, however, I noticed that something odd was happening: every Gyazo screengrab on the new Retina screen was about twice as big as I expected.
Note that while this article addresses an issue within the context of using Gyazo, because it’s more of a general OS X issue, the solution presented herein can be useful in similar scenarios.
I’m not sure where or when it happened, but at some point the JavaScript community decided that multiple, individual var statements were superfluous, instead opting for a single, combined var statement with a comma-separated list of variable declarations and assignments whenever possible.
Just in case you don’t know what I mean, I’ll illustrate:
// Single, combined var statement.
var foo = 1,
bar = 2;
// Multiple, individual var statements.
var foo = 1;
var bar = 2;
I’ve asked a number of talented JavaScript programmers why they prefer a single, combined var statement with multiple declarations and assignments to multiple, individual var statements, and the only responses I’ve been able to get seem entirely subjective:
- Multiple var statements are superfluous.
- Multiple var statements are noobish.
- Combined var statements look better.
While I can’t argue with the last point, in JavaScript, multiple var statements aren’t superfluous and they aren’t noobish. They reduce the effort it takes to maintain code.
These days, arguing over whether semicolons are optional in JavaScript seems to be all the rage.
Many people say that semicolons are optional in JavaScript. But JavaScript will insert them for you if they don’t exist. So clearly, JavaScript thinks they’re necessary, otherwise it wouldn’t insert them for you. Besides, if semicolons were optional, it wouldn’t be called “Automatic Semicolon Insertion,” but instead something like “Automatic Handling of Semicolon-less Code.”
Semicolons are required in JavaScript; they’re just not required in YOUR JavaScript.
Quod erat demonstrandum.
For the last few months, I’ve been working hard on grunt, a task-based command line build tool for JavaScript projects that facilitates creating new projects and makes performing repetitive but necessary tasks such as linting, unit testing, concatenating and minifying files (among other things) trivial.
Earlier today, I posted an article to the Bocoup Weblog introducing grunt, explaining why I created grunt (to make my life easier), how it was created (in Node.js JavaScript), how you’d go about using it (by typing grunt on the command line), who is already using it (the jQuery project for starters), and what its future looks like.
In addition, I’ll be in Phoenix, AZ next week for JSConf and will be talking about grunt for 15 minutes next Monday, on the “Twitter Track.” So if you want to learn more about how grunt works, first read my introducing grunt article. After you’ve done that, if you’re going to be at JSConf, come to my talk. And don’t be afraid to find me and ask me all about it!
This is by no means a complete list, but I just thought I’d share some of the cool NON-computer games I’ve been playing lately.
Off the top of my head, I’ve played Ticket to Ride, Dominion, Ascension, Carcassonne, 7 Wonders, Pandemic, Forbidden Island, Set, Lost Cities, Neuroshima Hex, Ingenious and Robot Master recently. I own physical versions for about half, iOS versions for the other half, with plenty of overlap somewhere in the middle.