1,614 karma · joined August 25, 2010
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).
Haven't tried Librarian - only because I saw Berkshelf first and it integrated nicely with Vagrant.
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?
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.
* I'm sure Matthew realises but just gave the first example that came to him.
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
> 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.
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".
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).
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.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.
Really inspiring, painstaking piece of work.
- @ for instance variables
- #{} interpolation
and Python:
- for comprehensions
- significant whitespace
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"[1] https://github.com/mishoo/UglifyJS/blob/master/lib/parse-js....
"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"
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.
In comparison with Selenium, I've found unit and integration tests using this setup fast and resilient.