HNHacker News
TopNewBestAskShowJobs

timruffles

1,614 karma · joined August 25, 2010

timr.co
submissionscomments
timruffles··on [dead]
Good round up of things that make me unreasonably annoyed about APIs I've used. ESPECIALLY 200 codes for errors, which means your error handlers won't fire.
timruffles··on Don't build a Galapagos product
I'd guess you're more likely to fail building a product for 'everyone' than for a niche. Therefore I'm not sure it's productive to worry about the size of niches unless you really are only interested in building a huge company (which seems not to be how most people who actually do build huge companies start out).

If you're aiming for a niche you likely know something about it - or at least can learn & validate quickly. If you're aiming for 'everyone' you're likely either a) solving a non-problem that everyone has (e.g walking: Segway) b) solving a problem nobody has (it's too small, or non-existent).

timruffles··on If you love automation, why is your development environment manual?
I used Berkshelf and it works nicely! The only confusion comes when actually deploying via Chef solo and I forget to ensure the cookbooks are actually present.

Haven't tried Librarian - only because I saw Berkshelf first and it integrated nicely with Vagrant.

timruffles··on Ghost: The Future of Blogging (Node.js)
Why? Open Source just means the source is open. There's nothing to say it can't be paid for up front, or even that the binaries are free.
timruffles··on Why Ruby?
Because a single project in a language has Mac only development instructions the language and ecosystem is Mac only? What leads you to think the discourse devs would have documented x-platform if using node?
timruffles··on Why Ruby?
Sorry but that's total FUD and has a very obvious agenda. Ruby is preinstalled on most Linux distros, and thus Rails is a gem install away. In production, people only run Ruby on Linux. I, and a heck of a lot of people, do all Ruby or Rails dev on Linux. So I guess you must mean Windows.

So perhaps what you actually meant to say is that Microsoft haven't stepped in to do all the work for supporting Ruby on Windows, like they did with Node?

timruffles··on The DOM isn't slow
No way - even if it was the sole performance bottleneck in your application (which as I've commented above is absurd, and a sign you're doing it so very, very wrong). Even if your application was:

var i = 100; while(i--) els[i].addEventListener("click",fn);

it'd be untrue jQuery is nowhere _near_ 100x slower. Profiling this is totally ridiculous because there's no use case that requires adding event listeners at a scale that could _ever_ be a performance concern, but anyway - http://jsperf.com/jquery-on-vs-native/3. So just 10x slower on even this - completely not performance critical and therefore nobody would bother optimising it - method.

timruffles··on The DOM isn't slow
In case anyone reading doesn't realise* - that's not the kind of thing you'd be doing to get a speed up. I can't think of how addEventListener could lead to a 1.001x speedup of an app, let alone a 100x. You don't ever need to create listeners in loops, so a single operation like that just isn't a optimisation target. If you need to listen for an event that could come from lots of nodes, listen for the event bubbling up to the parent of those nodes.

* I'm sure Matthew realises but just gave the first example that came to him.

timruffles··on Code Reads
I'd like to offer the same service free to anyone would like a Code Read but Jeremy's rate is too high/he doesn't have time.

I'd get a lot out of it as I'm building a Javascript static analysis tool - exposure to lots of production code would identify how useful its features would be.

I'm no Jeremy Ashkenas, but:

- I've been writing JS apps since 2009, after I stopped doing AS3 apps with Flex

- Teach Backbone.js, JS and d3 at General Assembly, have given various talks/workshops

- Lead dev on two 10k+ LOC JS apps (for Picklive and Skimlinks) using Backbone.js

- Built 3 game clients for Picklive with JS, on mobile and web

- Built a visual scraper recorder/runner plugin for Chrome for Arachnys

- Contribute to JS open source - shims, Sinon.js, lots of little pull requests

https://github.com/timruffles @timruffles

timruffles··on Python trademark at risk in Europe
EuroPython conference - Googling I get mentions back to 2001. I'm sure you could get in touch with the organisers for promo material etc http://mail.python.org/pipermail/europython/2001-November/00...
timruffles··on Write More Classes
I think

> A class makes that simpler because each of the methods are extension points you can override.

is a strong argument in favour of classes. They're more extensible even if the author doesn't consider it. However - as soon as your class has an implementation like

  def to_json(str)
    JSONParser.parse(str) # JSONParser is not streamed
  end
then you're in trouble. Unless your language supports dynamic lookup of constants, class names feel very much like a global variable that's a pain to change. In Ruby, as of 1.9.3, lookup is lexical so you can't simply define a class-local value for the JSONParser constant.

I don't know the story in other languages - I assume Java has it as you see a great emphasis on dependency injection. If dynamic lookup of constants was present I think classes would be more unintentionally extensible however they were written - as it is, you have to be as careful writing classes for extension as for functional code where you have to manually provide extension points.

timruffles··on That Daily Shower Can Be a Killer
Reminds me a lot of Nassim Taleb's focus on payoff/cost (expected outcomes) vs probability. If the possible costs are high enough, it makes a lot of sense to take precautions. Hardly rocket science - seat-belts, hand-rails, smoking etc.
timruffles··on Backbone.js 0.9.9 Released
FUD. I've had several developers over several teams pick up Backbone significantly faster than 1-2 months. I'd strongly recommend over generalising from personal experience, and perhaps considering why Backbone has so many devs using, and contributing to, it.

I've been writing MVC apps in JS and ECMA script in general (eg AS 3) for a good time now, and have used other MVCish frameworks before (Dojo, Flex etc). Backbone has a solid implementation of models, views and events. If you understand the fundamentals of Javascript (knowing event listener closures are references that'll prevent GC) and write modular code you can do great things with it without any "mess".

timruffles··on Results from my Reddit advertising attempt
I loved 500px's terms and conditions page, but it's designed as a terms and conditions page. It's still enormously wordy. Additionally, all I saw in the ad or landing page were pleas for help - I was never sold the benefits.

I'm no copywriter/designer, but prehaps try rerunning the ad and A/B test some designs/headlines that sell the benefits ("no more real estate agents" or w/e the benefit is to redditors).

timruffles··on Show HN: DubJS: A New Way to Build Web Apps
I can't see how the compiled code for Type is supposed to work?

If you deference a JS function from an object, you lose the context of `this`. So in

    Ruby.prototype.cut = function () {
      this.shape(); this.polish();
    };

    var old = Ruby.prototype.cut;

    Ruby.prototype.cut = function () {
      old(); this.engrave();
    };
`Ruby.prototype.cut` will be called with `window` as `this`, so `this.shape` will be undefined. Use `old.call(this)` to get the behaviour you want.
timruffles··on Samwers Clone Stripe
I agree, it's been a long time coming. Might be a pain for Stripe but competition is great for everyone else.
timruffles··on Joe Armstrong: Why OO Sucks
I think a project along the lines of Todo MVC for general programming languages - https://github.com/addyosmani/todomvc/ - would work really well for illustrating these kind of debates.

Ideally it'd be a reasonably involved problem domain (rather than a todo list) with persistance, networking and something which requires parallelism/concurrency (I'm sure there are other categories too). This'd expose each language to the types of complexity that exposes the really interesting differences - does language X allow a clean API even when we require immutability for parallelism, does language Y impose boiler plate on simple problems, Z require unreadable line noise?

I find these debates nearly useless without evidence and code to read.

timruffles··on Experiment: Unit testing isn't enough; You need static types, too
I wish more of these open questions in coding (and everything) had people making such a good effort to research them! There never is a simple answer, or they'd not be an open question.

Really inspiring, painstaking piece of work.

timruffles··on Does anybody use Maglev Ruby in production?
Let me know if you find out anything about this. Seems a strong technology!
timruffles··on Stop writing classes...
Tools to reduce the burden of tautology are workarounds. You can rely on tools to make the worst design/language less painful, but it's not an argument against avoiding tautology.
timruffles··on Stop writing classes...
That is fascinating, and I for one would get a lot out of seeing some code. Any chance of posting your prototype in a gist please? :)
timruffles··on CoffeeScript is Afrikaans JavaScript
Perhaps the author meant for those who know Ruby:

- @ for instance variables

- #{} interpolation

and Python:

- for comprehensions

- significant whitespace

timruffles··on IcedCoffeeScript
There is a way around it. Here, everything after the await is transformed into a callback for the await magic:

    waity = (forFn) ->
      await forFn defer r1, r2
      console.log "values of defer variables", r1, r2
      return "this only returns from the result callback, not waity"

    syncReturn = waity (cb) ->
      setTimeout ->
        cb "r1 val", "r2 val"

    console.log "waity's synchronous return value:", syncReturn
So our output is:

    waity's synchronous return value: undefined
    values of defer variables r1 val r2 val
To return, you can simply write:

    waity = (forFn) ->
       setTimeout -> 
         await ...
       return "works as normal"
timruffles··on Direct Debit API for 1%; max £2
£2 is the most you'll pay as a fee. 1% or £2, whichever is lower.
timruffles··on Google: Focus on the User
Focus on the... profits of our respective companies perhaps? If users want this 'feature' they'll switch to a search engine that supports it. In that case these companies are wasting time whining when they could be scooping up these users. Clearly they don't actually believe users care, so they're whining about it instead.
timruffles··on Jquip (jQuery-in-parts) releases a library builder service
Using something like uglify's parse-js.js [1] that gives you back the AST might be the right way to go about it. Just count the calls to each $ method in your code.

[1] https://github.com/mishoo/UglifyJS/blob/master/lib/parse-js....

timruffles··on Why UK startups should stop trying to be US startups
OP is using the example of language to highlight a larger problem, not identifying it as a major problem in itself. That problem being aping US startups at the cost of an authentic, interesting local identity:

"To succeed UK tech companies must find the rich vein that defines the area that they are in or defines them as individuals. The thing that makes them interesting. It might be a genre, a technology, a specific problem that needs solving in their lives, a cultural phenomena (for ages SMSing was not popular in the US) or a style"

timruffles··on Ask HN: Copy & Undercut. Should I do this?
I think that's a fantastic way of thinking about it. Businesses don't win custom by doing totally unique things, but by doing common things in a way that is local/prettier/cheaper/easier/in a language you speak/on a device you own.

I think you've changed the way I'll look for "the idea". Not something new, but a problem I can solve, that people have and that scales, that other people like me don't want to touch.

One of the best comments I've read on HN, especially for stressing the complexity of why a product works. Thanks Daniel.

timruffles··on Ask HN: What do you use to test Frontend code?
We use jsTestDriver at Picklive to test our game, alongside Sinon.js for a mock implementation of our game server. It's very easy to test simultaneously on multiple browsers, run tests on the command line, and we run it headless for continuous integration.

In comparison with Selenium, I've found unit and integration tests using this setup fast and resilient.

timruffles··on Think Stats: Probability and Statistics for Programmers
Very much so. Still trying to find out exactly what maths will be required, I'm looking at things from related courses http://see.stanford.edu/see/courses.aspx.
← PreviousPage 4 of 6Next →