HNHacker News
TopNewBestAskShowJobs

mjackson

516 karma · joined March 30, 2012

Co-founder of React Training. http://twitter.com/mjackson
submissionscomments
mjackson··on JavaScript Promises: There and back again
> The real problem is the core NodeJS libraries aren't promise compliant.

This isn't a problem at all in practice.

To say that node core is not "promise compliant" gives people the idea that there is something that prevents them from using promises in node. In reality, most promise libraries have a "denodeify" function that will convert any function that expects a node-style callback into one that returns a promise instead.

  var fs = require('fs');
  var rsvp = require('rsvp');
  
  // Create a version of fs.readFile that returns
  // a promise instead of expecting a callback.
  var readFile = rsvp.denodeify(fs.readFile);
  
  readFile('/etc/passwd', 'utf8').then(function (contents) {
    // do something with the file contents
  }, function (error) {
    // handle the error
  });
It is similarly easy to convert functions that expect other types of callbacks (read: not node-style callbacks where the first argument is always an error) to functions that return promises using deferreds.
mjackson··on An In-Depth Introduction To Ember.js
Very well said.

One thing I might add for others who read this is that many of Ember's design patterns are modeled after Cocoa, which has proven to be one of the world's most robust platforms for building apps. If you're familiar with Cocoa's two-stage object instantiation, MVC, or first responder patterns you should be able to recognize them fairly easily in Ember.

mjackson··on Twitter Prices IPO Above Estimates at $26 Per Share, Valuation Up to $18B
They're selling 70M shares, aiming to raise approx. $1.8B. However, there are over 700M fully diluted shares. At $26 a piece this makes a total valuation of $18B.
mjackson··on Riot.js – A 1kb client-side MVP framework
There isn't very much to see here, if anything. A few meaningless microbenchmarks, and some "plain old JavaScript objects" that hijack jQuery's event subsystem so they can emit events just like DOM elements. We've been doing imperative, evented programming in the browser for years now.

Even if you're inclined to argue that this style of programming doesn't lead to a giant mess (and I'm inclined to believe that it does, even if you are the most disciplined of programmers) I still don't see the benefit of adding this 1K of JavaScript to my page at all. I can duplicate $.observable with a vanilla jQuery object.

To call this the "most powerful client side framework for building large scale web applications" is downright laughable.

mjackson··on Node.js and the new web front-end
> Because static type analysis allows you to develop more accurate code faster and with lower maintenance cost.

This statement may be true for you, but it's not for everyone.

It's a dangerous argument because it assumes that static types are going to somehow magically turn bad code into good code, or (by extension) bad coders into good ones.

Static typing is a not a solution to the problem of any deficiencies in the language, but rather the problem of people shooting themselves in the foot with it. It's admittedly a related problem, but a separate one.

mjackson··on Node.js and the new web front-end
> As much as I love JavaScript, there are just some things I don’t want written in JavaScript – my shopping cart, for example.

After developing almost exclusively in JavaScript for the better part of the past year (and doing a lot more in the previous 6), I'm convinced that this mentality is going to start fading as more and more developers become more capable and productive with JavaScript.

There's nothing inherently wrong with the language that prevents you from writing sufficiently complex and reliable systems to power something like a shopping cart, or anything else for that matter. The main thing that is missing at this point is experience and maturity in the JavaScript community at large, which is quickly changing as more and more developers start embracing the language.

mjackson··on Kal – a clean JavaScript alternative without callbacks
I don't ever write code like this personally. The multiple levels make it more difficult to reason about, IMO.
mjackson··on Kal – a clean JavaScript alternative without callbacks
For the curious, the equivalent example from the OP using promises[1]:

  function getUserFriends(userName) {
    return db.users.findOne({ name: userName }).then(function (user) {
      return db.friends.find({ userId: user.id });
    });
  }
[1]: http://promises-aplus.github.io/promises-spec/
mjackson··on Leaked transcript of censored Bret Victor talk
This is brilliant stuff. And yes, it's satire. Wish I could upvote a bazillion times.
mjackson··on Show HN: NameMonk – fast domain search using web sockets and Bloom filters
My favorite: http://instantdomainsearch.com

Includes the ability to save and encrypt searches, links to whois data, as well as alternative names based on similar spelling.

mjackson··on Why You Shouldn’t Join Medium
This post does not contain a single criticism that indicates a fatal flaw in the platform. Design flaws and analytics can all be improved.

What he fails to mention is how Medium is actually moving web publishing forward. It's not supposed to be like your personal blog. Instead, it's a collection of stuff from all kinds of people on the same/similar topics.

svbtle is the new 9rules. Medium is a different animal.

mjackson··on Salt: Like Puppet, Except It Doesn’t Suck
Browsing around ansible's website, I found the "quickstart" link. From that page[0]:

> We’ve recorded a free 2-hour presentation designed to ...

Wait. The quickstart presentation is 2 hours?!

Looking for an easier way to get started...

[0]: http://www.ansibleworks.com/quickstart/

mjackson··on AngularJS Screencasts
Short, sweet, and to the point. Thanks!
mjackson··on Redis-V8
This was submitted way too early (some of the pages are still "lorem ipsum" placeholders), but it's still cool. Looks like the author is basically using V8 to script Redis, similar to how Lua can be used [1] to script it already.

[1]: http://redis.io/commands#scripting

mjackson··on Heroku Platform API, Now Available in Public Beta
High five for the Heroku API designer who decided to use the Accept header to indicate the acceptable format and version of the response. This is the way to design HTTP APIs.

Instead, most companies put the version number in the URL and use special suffixes on the URL like ".json" to indicate these things. I can understand this practice from the standpoint of convenience. A human using cURL can't be bothered to type out an Accept header. But when building an API support should first be considered for explicit, programmatic API clients, not humans. Then you can slap on your human-friendly URL extensions, etc.

It's always easier to start out being explicit.

mjackson··on Why I left Heroku, and notes on my new AWS setup
From the OP:

> I changed the app to use cookie-based sessions, so that session data is stored in signed cookies rather than in memcache. This way, the web app servers don't need to share any state (other than the database). Plus it's faster for end users because the app doesn't have to hit memcache for session data.

The switch to using cookies for storing session data instead of memcache has tradeoffs. Sure, you no longer need to ask memcache for the session data. But you are also shipping a significantly larger cookie back and forth on every request.

If you're storing a lot of data in your session, this could actually slow things down in the long run. [1]

[1]: http://yuiblog.com/blog/2007/03/01/performance-research-part...

mjackson··on An Appeal to Google: Make ".io" a gccTLD
> this is a dirty hack

I disagree.

This is people starting businesses within a reasonable budget. I assume you've tried to purchase a reasonable domain name in the gTLD space. If so, you already know that a name like "filepicker.com" or "forecast.com" is going to cost you in the tens of thousands USD.

I have personally worked for companies where we paid upwards of $200K for a nice, short gTLD domain name. Unless you've got money to burn from the A-list of SV VCs, your startup simply can't afford it.

mjackson··on Elixir, a functional metaprogramming-aware language built on the Erlang VM
If you're interested in doing web stuff with Elixir, check out Dynamo: https://github.com/elixir-lang/dynamo

It's a web framework developed and maintained by the Elixir core team, and I've had fun playing with it recently. It already supports a lot of the most common tasks when doing web development including request routing, parsing of parameters and cookies, and pre/post-request hooks.

mjackson··on Elixir, a functional metaprogramming-aware language built on the Erlang VM
> Where is the language documentation?

The language is documented extensively under the Getting Started section of the website. It's a pretty easy read and really helps to understand the pieces of the language that make Elixir so powerful.

mjackson··on Bitcoin falls from $266
Get ready for the massive pop sound...
mjackson··on Callbacks are imperative, promises are functional
> There still isn't a canonical Promises specification.

Yes, there is: https://github.com/promises-aplus/promises-spec

mjackson··on Jacob Kaplan-Moss, Django Co-Creator, Talks Ecosystems at Heroku's Waza
Watching the video is so much nicer directly on Vimeo: http://vimeo.com/61059530
mjackson··on Heroku Blog: Routing Performance Update
tl;dr Don't run your single-threaded Rails app (read: the vast majority of Rails apps) on Heroku. Neither the Cedar or Bamboo stacks are optimized for them at this point.

It's incredible to me how the performance of their stack has degraded so far for what is probably the most common use case for their platform.

mjackson··on Announcing Topaz: A New Ruby
It's not quite Ruby on top of Erlang, but you might be interested in Elixir (http://elixir-lang.org/). Elixir has some of the syntax of Ruby but is built on the Erlang VM.
mjackson··on What Is It Like To Be an Adult and Not Have Kids?
> We've always had two or three dogs at a time, and they've had our love, attention, and affection. They're spoiled rotten. Better dogs than children.

One very common trait among people I know who don't have kids is that they have dogs. For them, dogs help to fill the need they have for unconditional love and the seemingly built-in paternal/maternal need to care for someone. That's great. Nothing wrong with that.

I've had lots of dogs in my life. In my experience, the dogs were fun. We played and wrestled and went on walks and went to the park. I was sad when they passed away.

I also have three children. I can honestly say that I never experienced anything close to the feelings I have for my children with the dogs. My children look like me, and like the woman I love. They think deep thoughts and ask questions and figure things out.

Instead of teaching them to sit or rollover (though you have to start somewhere!) I teach them to reason and understand. I try to teach them as best I can to be a good person. That's a process that has inspired deep introspection and personal growth, as well as some of the best work I've done in my career and my community.

Owning a dog is certainly easier than having a child, by which I mean it's a lot less work. So if easy is your metric for better you could probably say something like "Better dogs than children." But using every other metric that I can think of I would say the opposite.

mjackson··on Twemproxy, a Redis/memcached proxy from Twitter with auto-sharding
Related: The director of Twitter's Application Services group, Raffi Krikorian, gave an interesting talk about the architecture of Twitter's real-time delivery service at QCon in October. In the talk he discusses in pretty good detail the ways in which Twitter uses Redis to cache copies of users' timelines as tweets are made.

Here's a link to a video of the talk: http://www.infoq.com/presentations/Real-Time-Delivery-Twitte...

mjackson··on Textmate2 Goes Open Source
So awesome. Thank you Allan.
mjackson··on Meteor Raises $11.2M from Andreessen Horowitz
Ditto.

Another good example is Cappuccino/Objective-J. One of my favorite things about the whole Cappuccino/Objective-J framework was that 280 North built 280 Slides with it very early on. Going through the paces of developing an actual app with your framework is an essential process to creating something really useful.

The fact they've already decided they're not going to actually build a sellable product on top of it anytime soon is worrying, to say the least.

mjackson··on PHP Addiction
The reason you describe your relationship with PHP as an "addiction" instead of using a word that described a more healthy relationship is probably because there is something about it that doesn't resonate well with your core values. At least that's the problem that I had with it.

If you want a nice introduction into the world of developing web apps with Python, I suggest you read the Flask user manual (see http://flask.pocoo.org/docs/). It not only covers the basics of the framework, but also seems to assume that you're a first-time Python user as well. It covers topics such as using virtualenv and pip to setup your environment which I found very helpful when getting started with the language.

mjackson··on The Startup Hustler
The need for a "startup hustler" is a myth. Of all the startups I know of out here in SF and SV, I can't think of any good ones that have needed this kind of person around.

The part about impatience is especially dangerous. Being impatient with your business is a good way to produce something of low quality because you just didn't take the time to get it right.

← PreviousPage 2 of 3Next →