HNHacker News
TopNewBestAskShowJobs

tbranyen

484 karma · joined January 8, 2011

i work at netflix in san francisco writing web applications
submissionscomments
tbranyen··on GithubViewer - New Example Backbone/Bootstrap Application
Full source code available here: https://github.com/tbranyen/github-viewer
tbranyen··on Integration testing Backbone.js
While you may have confidence your code is working as expected, you are missing out on the importance of unit tests. The point of unit tests is to ensure your code works as expected. In your write up all I see are tests for Backbone.js, which btw, already has unit tests.

When you do something like:

var collection = new SomeCollection(); collection.fetch();

assert(collection.length === some_number);

How are you testing your code here? You're going through the library abstraction which is Backbone. The tests are making sure Backbone can fetch and populate a collection.

I'm not sure I see the value. Instead you should be testing that your code is set up properly and leaving the trust to Backbone which you're using because you have some level of trust in it =)

tbranyen··on [dead]
Well the README does say: "No license, do what you want as long as it involves some Cool Ass Lakes."

Sounds legit to me!

tbranyen··on Crockford on Bootstrap's semicolon omission: “insanely stupid code”
Allow me to explain further, as I've been down-voted a few times.

My point is that its stupid to use a tool on code it was not written to support. If you want minification with valid JavaScript, use something like Uglify-js.

If you write code, however, that works with JSMin, then use that tool. Douglass Crockford can write his software to work any way he likes and support any code he likes. Don't like it? Use something else, and don't be stupid.

tbranyen··on Crockford on Bootstrap's semicolon omission: “insanely stupid code”
I think the stupidity here is entirely isolated to using JSMin.
tbranyen··on Announcing Backlift: Deployment and Hosting for Backbone.js
I'm rather confused about a few things:

1) Is there no index.html?

2) Can you develop locally?

3) How do you use the templates you showed?

4) Is the boilerplate you provide open sourced anywhere?

tbranyen··on Announcing Backlift: Deployment and Hosting for Backbone.js
Yeah didn't work for me either.
tbranyen··on Coderwall (YC W12) Wants to be the Reputation System for Developers
I think Coderwall is fun, but probably not something I'd ever take seriously. Especially since it's easy to tailor your account to get more achievements.
tbranyen··on Essential JavaScript Design Patterns For Beginners
Well I'd love to know which DOM library you're hiding behind your words, that you believe is de facto.
tbranyen··on Essential JavaScript Design Patterns For Beginners
Why would you include ES5 shims instead of using code that's well tested, already written, and bundled in a neat package.

jQuery is the de-facto DOM library (whether it should be or not), failure to see this is ignorance.

tbranyen··on Microsoft’s Biggest Miss
The arguments are weak, but the message is strong. I use Microsoft to play Skyrim, the rest of my work is done with open source.

Not everyone can/will take this route, but they've certainly lost me as a customer for anything other than video games.

tbranyen··on Show HN: documentation generator based on markdown files in node.js
Yeah I thought the same thing only DocumentUp has a better design/concept.
tbranyen··on Sample App with Backbone.js and Twitter Bootstrap
There are a number of issues with the project, but I'm assuming it was created this way to be easier to digest for newcomers.
tbranyen··on Restify 1.0 for Node.js is officially out
I'm confused as to why these frameworks don't use the full delete identifier and instead opt for del. delete is a completely valid property identifier for objects and can be accessed identically to del and is significantly less confusing.

If you are using full verbs for everything else, stay consistent please :-/

tbranyen··on Startup Data Trends
We have a post on it as well on our blog:

http://weblog.bocoup.com/startup-data-trends/

tbranyen··on Introducing the Backbone.js Boilerplate
In case there was any confusion here, I meant "Get a job, hippie" in the lightest and most facetious way possible to interpret the phrase.

It was not meant to be insulting.

tbranyen··on Introducing the Backbone.js Boilerplate
"Boilerplate", as I understand it, is text you copy and paste, and then edit to your needs. But the name of the game in programming is "don't repeat yourself", that is, don't copy and paste text.

This post has 193 upvotes as I write this so I guess there are at least 193 non-hackers reading and voting on Hacker News. I hope I never have to fix their code.

=========

Way to miss the entire point of DRY and insulting the people who will find this useful. Get a job, hippie.

tbranyen··on Introducing the Backbone.js Boilerplate
Yup, https://github.com/tbranyen/backbone-boilerplate/issues/22

Currently anyone can use require.js. Delete the build folder and update the index.html.

tbranyen··on Introducing the Backbone.js Boilerplate
Fixed thank you =)
tbranyen··on Introducing the Backbone.js Boilerplate
Awesome, its still new, so make sure you report any issues you find.
tbranyen··on Introducing the Backbone.js Boilerplate
You would modify the folder structure of the boilerplate to accommodate the framework. Assuming your framework does asset building as well, you can just delete the build folder.
tbranyen··on Create - A new kind of web editing interface
Backbone.js huh =) We should get you on the homepage.

Submit a pull req or contact me on GitHub.

tbranyen··on Organizing Your Backbone.js Application With Modules
I am working on a follow up post, where you will see how complicated these systems get. Its not trivial nor foundational for anyone looking on how to structure a project.

Edit: There is a pull request that would make using at least jQuery/Backbone/Underscore easier to use together, but it has n't been pulled yet. Writing posts on stuff that just works, is better than trying to convince developers to hand write wrappers for every lib they want to include.

tbranyen··on Organizing Your Backbone.js Application With Modules
This pattern uses an immediately invoked function expression (IIFE) to scope dependencies and shorten variable names.

Be smart about your code, you can expose anything you want and attach anything to the module object for testing.

tbranyen··on Dart language
Much appreciated. =)
tbranyen··on Dart language
For what its worth, I felt really awkward reading many of your replies in this thread. You are our spokesperson for JavaScript and the CTO of Mozilla. It would be nice if you could talk to people without making disparaging and downright condescending remarks.

I look up to you to speak for the community and to use judgement and character. Anyways, maybe I'm just being too sensitive, but I figured I'd say something.

tbranyen··on Organizing Your Backbone.js Application With Modules
We are planning a follow up post on this soon that will discuss using script loaders and libraries that assist in organizing code into modules.
tbranyen··on Linus Torvalds now on GitHub
swoon
tbranyen··on The Strategy Pattern in JavaScript
You definitely missed this part in the second paragraph:

"This leads many seasoned programmers to respond with, “well, duh” when first confronted. Design patterns are derived from scrutiny of best practices in the real world (not your old CS prof’s black cauldron)."

tbranyen··on The Strategy Pattern in JavaScript
Pretty much. I'm using this pattern in the following way:

SomeComponent.prototype.views = { home: { template: '/path/to/template', render: function(tmpl) { this.element.html(Mustache.to_html(tmpl, this.data)); } } };

I then have SomeComponent inherit the prototype of Component which has a generic render method. When I call the render method on any given component, it will have some logic to figure out which view it is in, then call the render method specific to that view with the correct template, that it fetches the content of under-the-hood.

Having consistent and expected behavior in your code is a huge win.

← PreviousPage 4 of 5Next →