HNHacker News
TopNewBestAskShowJobs

nxn

238 karma · joined June 30, 2010

submissionscomments
nxn··on Simple JavaScript Inheritance with Backbone
I don't even know if this can be considered the "closure" pattern anymore, but I wanted to try to get method sharing among the objects by doing something like this: https://gist.github.com/877259

The hope was that since the functions were created and bound within the function literal, the "create" method could simply assign references to the existing functions instead of creating a new function each time (ie, avoid what munificent mentioned).

Funny thing is, even though the last line indicates that the first and last objects' "ten" method is actually shared between them, I'm still getting about 370 MB of memory usage after creating 1 million objects. I am under assumption that the cause of this memory increase is the fact that each one of the million objects has its own local references to each of the 10 functions. When I put the 10 functions inside of the "create" method, memory usage goes up again to roughly 750 MB.

nxn··on New Chrome Logo
Yep, in fact I like this version I found earlier a lot more than the one they went with: http://www.frazpc.pl/b/275384
nxn··on Ela Programming Language
Yes, I completely agree with this. I don't see much advantage in knowing languages that all look and behave very similarly to each other. Why should the only reasonable choice be no choice at all? Though, I suppose, that's probably saying too much.

On a side note, and perhaps I'm biased in believing this, but I find the given Haskell "expression" like syntax to be much easier to understand than reading imperative code. Of course, you have to know some fundamentals behind functional programming before it starts making much sense, but once that ground work is there, the experience of reading other people's code is quite enjoyable. To me, it just seems like the code is more concerned with the problem it's trying to solve than battling the nature of the machine that it is running on.

← PreviousPage 7 of 7