« first day (417 days earlier)      last day (4537 days later) » 

2:00 AM
@Esailija I know they do, it would be stupid to not do so
The main point is those libraries give you junk you dont want
pd gives you the lower level utility building blocks you do want
 
It's my library that I am working on
Probably like 6th on inheritance =D
basically if you don't define a constructor for a sub class, the parent constructor is automatically invoked when you instantiate a new sub class
if you however define a constructor for the sub class as well, you call this.parent( arguments )
 
var person = (function() {
    var privates = {};
    return {
        troll: function() {}
    };
});

var jandy = (function() {
    var privates = {},
        data = person();

    data.bar = function() {};
    return data;
}());

jandy.troll();
@Raynos: what makes that different from doing it with prototypes
 
@jAndy
 
Also I love final and static =)
 
person.foo = 42;
assert(jAndy.foo === undefined);
The main and only thing prototypical OO gives you is live links
the fact you walk the inheritance chain at run-time
if you don't want that feature don't use inheritance
 
2:05 AM
RT @miketaylr: Opera 11.60 was released today. @brucel writes up what's new: http://my.opera.com/ODIN/blog/2011/12/06/hello-opera-11-60
 
@Esailija the main difference is that library does a lot of magic for me I dont want to be done
1 message moved to bin
gist: The heart of pd, 2011-12-07 02:07:28Z
function beget(proto, ...args) {
  var o = Object.create(proto);
  o.constructor(...args);
  return o;
}

function make(proto, ...props) {
  var o = Object.create(proto);
  extend(o, ...props);
  return o;
}

function extend(o, ...other) {
  [...other].extend(copyProperties);
  return o;

  function copyProperties (source) {
    Object.getOwnPropertyNames(source).forEach(copyProperty);

    function copyProperty(name) {
      o[name] = source[name];
    }
  }
}
Again I'm just illustrating that all pd does is offer you three re-usable utility functions that are your OO building blocks
it doesnt dictate anything about how you do things or style
Although it does do some promoting, mainly because my examples are written in a particular style
 
I'm still poundering if that is always what you want to have... a 'live' reference in either way
 
@ThomasBlobaum this is applicable to you to. pd does three things and three things well and that's giving the building blocks defined above.
@jAndy I do
 
@jAndy, are you questioning the benefit of inheritance or something
 
It allows me to fix objects after they are created
@jAndy without 'live' reference there would be no monkey patching
 
2:10 AM
@Esailija: no, not at all.
just for the example above, the jAndy object still inherits from the person object, but you only have that 'live' reference within the object of course
I actually like not to have access to those objects from like everywhere
 
but you are using a singleton there?
how would I create more jandys
or is that just an instance of person or whatever :D
 
@Esailija its not singletons
its factories
He was just lazy in his example
an immediately invoked his anonymous jAndy factory
 
but if he wouldn't immediately invoke it, it would be evil closures all over the place when you create new instances
 
@jAndy again I thought about this myself. And I came to the conclusion you dont need inheritance unless you want live links. You can just use extend
 
don't get me wrong, I'm still a learner and I always want to improve my techniques, I need to ask dumb sometimes :p
 
2:14 AM
@Esailija well no. That was just his bad code
 
@Raynos: yea that was my next point, object composition over inheritance ?
 
var Klass = { ... }

var SubKlass = extend(Klass, { ... });

var SubSubKlass = extend(SubKlass, { ... });
5
A: Inheritance vs mixins in dynamic languages?

RaynosPrototypical inheritance is simple. It has a single advantage over mixins. That is that it's a live link. if you change the prototype everything that inherits it is changed. Example using pd var Circle = { constructor: function _constructor() { this.radius = 0; return this; }, ar...

 
@Raynos, yes it would. If jandy was a factory instead of returning immediately, anytime you created jandy you would create a new closure as well because there is a function created in the factory
 
RT @annevk: Aligned the Live WebVTT Validator with the standard. See http://quuz.org/webvtt/ & https://bitbucket.org/annevk/webvtt #webvtt
 
@Esailija that's just his bad coding style.
I would assume he's being lazy in his example
 
2:18 AM
you cannot have the private data thing without having some form of closure somewhere
it's good if its only get created once but if you are creating on every instantiation on a complex class, hello 200 mb memory use on a nice size app :)
 
var jAndy = { ... };

var jAndyFactory = function () {
  var data = person();
  extend(data, jAndy);
  return data;
}
@Esailija not really, you over estimate the overhead of closures
you underestimate how good compilers are at optimizing
 
actually I do use factories all over the place in most of my stuff
its not a huge memory usage
 
it depends on how many functions are created everytime and how much data the closure holds and so on
 
Also not how jAndyFactory looks similar to make
@Esailija not really the memory overheads are small
For example
 
No they aren't my app with not many instances used 100mb memory vs 10mb memory it uses now
I have been using that pattern, it was in javascript good parts after all
 
2:22 AM
var o = {};
large.forEach(function (val, name) {
  o[name] = function _largeFunction() {
     /* I do not use closure variables at all */
  };
});
The memory size of o doesn't ramp up anywhere near as fast as you think
v8 optimises those functions as two objects
 
I'll try to make an example
 
one is the closure object which is unique per function, empty in this case
the other is the common funciton code which is the same
@Esailija my main point is only multiple functions that are the same share a single function body object
the only thing unique to the function is the closure state object
What your saying is simply not true in sufficiently well optimised browsers
 
nope, if you have a class that creates 12 functions, you will create 12 new closure objects in memory as long as the new instance is referenced
You can investigate with heap screenshots in chrome
 
12 new context more precisely
 
@Esailija yes but those 12 new closure objects are empty objects if they dont use anything
because chrome optimises that into empty objects
Sure theres a pointer reference
and a struct with meta data
 
2:25 AM
there is only 1 context but 12 closure objects in memory
 
I'm just saying the overhead is no where near as large as you think
 
one instance = one new context
 
a closure, technically, is just the lexically "copying" from parent contexts activation objects
 
The overhead is defiantly there though
 
thus, many functions which close over the same parents, share those access
Execution Context {
    this => context variable
    ActivationObject => {}
    ScopeChain => [parent1, parent2, parent3,..]
}
 
2:28 AM
Yes the 12 function batch access same variables
 
where parent1-3 are also ActivationObjects from parent contexts, which in turn, hold variables, formal parameters and functions decl.
 
Mind you v8 cheats
and parses your function for whether it references tokens from parent2
if it doesnt reference tokens it removes parent2 from the scope chain as an optimisation
It does the same with the ActivationObject, it removes any tokens not referenced by the current function
 
well, ok, why not
 
note with and eval count as referencing all tokens
 
the whole ActivationObject thing is history anyway, modern implementaions use that "lexicalEnvironment" object now to store and access contexts
but.. however, basically it remains the same story
 
2:31 AM
for example this uses 50mb memory for me when it might as well use 10mb jsfiddle.net/DWmCR/3
(closure) count 635847 shallow size 22mb
 
well.. again, technically any new function invocation generates an new execution context, which comes at a cost. But thats the way the language works right
 
I remove the function creation, and I use only 16% of the memory
 
especially when there are parent contexts to close over
 
for exactly the same effect
Snapshot with first one is 33MB, after removing the closures it's 6mb
but this is meaningless test, in real world app I had 100 mb for a program that uses now like 10-20mb
 
fiddle the second snippet please
 
2:35 AM
Just remove the while loop inside the class declaration
I can add a prototype but it's the same result sec
 
@jAndy jsfiddle.net/DWmCR/7 second snippet
 
Whether that be by doing it in a loop or by doing it in a function called in a loop
 
the loop doesn't matter, unrolled it's the same as adding 25 functions separately
 
@jAndy the problem is constructing functions in loops
The less inner functions you have the better. This is why I promote function declaration last style
I also promote, if the function dont use the closure move it outside that closure scope
function construct() {
  return I_do_not_use_closure;
}

funciton I_do_not_use_closure() {

}
 
2:39 AM
Basically the last link I gave which has prototype is exactly the same but 6mb snapshot vs 33mb snapshot
 
@Esailija not completely true
you use 25 functions instead of 1 :p
you can micro optimise it a little more
 
well prototype has 21 functions and the memory hog had 25 but yea
 
@Esailija the thing I was trying to point out is that its probably 6mb vs 300mb in ie6 :D
and that it's impressive chrome can get it down to 33mb
 
Yes but it's still horrible in chrome in real apps
at least for me it was :(
I dont have any need for real private properties so why eat the memory
 
well, I guess it pretty much depends what an implementation does when a new context is created
 
2:41 AM
yes it scales with complexity and what the functions do etc
but basically don't create new functions inside functions unless you have a good reason (like bind)
I call these evil closures because they are evil and use memory for no good reason =)
 
yea, that might be good advice
since I'm heavily using those constructs, I will have a second look over it :p
 
Correct, no-one needs real private properites
 
yeah I just use underscore prefix to mark that property as off limits
 
thats another raynos trolling there :P
 
@jAndy You know private objects are basically "developer convenience at the price of consuming RAM"
 
2:43 AM
even if thats true, how can convinience be wrong
 
Seriously though, no-one needs private properties. Those things are for Java trolls
 
jQuery doesn't even mark their private shit with underscore and they're doing fine :D
 
@jAndy same with es5 shim
 
You know, you get the ram back when the page loads...
*closes
 
es5 is developer convenience at the price of forcing users to download es5-shim.js
 
2:44 AM
but web app is running all the time
like your facebook page
it's using 100mb memory at the moment!
 
@jAndy because you should favour performance over convenience
and it's not even convenience
 
Facebook is 100mb?
 
after a while, yes
 
emulated private state has zero real value and is an anti-pattern
 
facebook is now at 80mb for me
 
2:45 AM
oh, you just made up that figure.
Really?
 
runtime only 12 hours
 
@Raynos: come one, seriously. that arguments counts for the shiny new webgl game you're writting, not for website code
 
well you can easily check it
 
@jAndy seriously, especially in node.js. Fucking rage that my website uses 70mb of RAM
 
indeed, I'd always prefer convinience and clearness there over performance
 
2:45 AM
in windows google chrome, press shift esc to see tab-wise memory usage
real private methods aren't any convenience... ffs use underscore prefix and call it a day =D
 
@jAndy it's not really convenience, it's just "a programming style/preference" that comes at the cost of performance
@jAndy why have Private when you can have Public._privateMethod
 
what's bad for performance?
 
almost not even measurable performance
 
@cHao closures
 
i've actually seen closures be faster.
 
2:46 AM
my facebook tab is 80mb, my hotmail tab is 110 mb
 
@Raynos: you really prefer a pseudo "character" prefix to be private?
 
@jAndy sorry what, 100mb vs 10mb
@jAndy it's more efficient and it does the exact same thing
it's a visual marker for the programmer saying this is private
 
@jAndy of course I would PREFER real private
but from pragmatic point of view?
use shit ton of memory or just prefix?
come on
 
I mean I would prefer real private it came at 0 performance penalty
 
shit ton...
 
2:47 AM
6 times more for a simple class..
 
@jAndy the difference is easily an order of magnitude
@jAndy why do you think firefox consumes 800mb of RAM over time
 
nah I could not respect my self for that I guess. but thats a personal thing I guess
 
because of the internet hogging all dat RAM
 
so why you're doing that private variable? because no one should touch it, not even by accident, it needs to be private for integrity again
so just prefix that and "hope"
naaahhhhh
not my thing
 
@jAndy dont agree. Dont give a fuck about integrity enforced by compilers
 
2:49 AM
Well, realistically, nobody isn't gonna not use your site because of ram consumption so...
 
Integrity is forced by three things. Programmer competence, failing that code review, failing that unit tests
 
If they really care, they'll go buy more ram so they can get their facebook updates asap
 
realistically no one even will notice that "more" memory usage
 
@Anfurny, have you used old firefox? You had to restart that shit all the time because it would use so much ram
 
beside he is a nerd
 
2:50 AM
@jAndy websites no. node.js yes, hell yes
 
No, I use chrome @Esailija
 
memory inefficient code in node.js is rage, absolute rage
 
I mean, back before chrome was "popular"
 
And if I had a problem, I would have switched browsers, not stopped using whatever web app I like @Esailija
 
Don't think firefox has the problem anymore even
It was not any webapp but the browser =)
 
2:51 AM
No I ran IE, and just didn't open 100 tabs.
 
well, to close the topic a little. Personally, I just love factories and method-object-patterns. It surely is mostly because of personal preference, but I feel that its a very nice and convinient way to have data structured code-wise, even with the benefit of real privacy so you can be sure, any bug is not related to corrupted data from the "outside" (even your own outside).
But you are right aswell, it takes more memory, as for browsers, I really don't care its not evil enough that I see the need to stop that.
 
more memory also means less performance :P
you know it takes some clock cycles to create to closures everytime as well
 
less performance? I don't think so, in what terms ?
@Esailija: typeofnan.com
 
yes it's a spinning cube I have seen it :D
 
does the box rotate slower as if I was using non factories
for a website, mostly any kind performance in that way does not matter
 
2:56 AM
depends, are you instantiating classes every time you do animation frame?
 
ofc not
but when do you do that
 
@cHao, there should be no difference for just one method
 
well, there is.
 
@cHao, it scales with the amount of methods.. with prototype it doesn't matter how many
 
2:58 AM
@jAndy the thing is you only see the performance differences if you invoke the factory enough
 
and you aren't even using prototype
you are using evil closures in both tests
 
1 instance, dont care, 10 instances, dont care, 100 instances, meh, 1000 instances, might care, 10000 instances, I bloody well care now. 100k, Y U NO PERFORMANT
 
heh
 
@jAndy why do we have sleeping problems?
 
how about 1 god class singleton
 
2:59 AM
@Esailija isn't that one called jQuery ?
 
because no one awakes them!
 
afaik , it is
mornings , everyone
 
@tereško y u wake early o.o
 
yeah shit it's 5 am
 
@tereško I mean its 1am where you are :\
 
3:02 AM
and I have a meeting 10am
 
@jAndy seriously its 4am in germany, how can you go to your job :\
@Esailija you have problems too
What is wrong with us ;_;
 
I just fixed my sleeping pattern for my girlfriend and here we are...
I woke up 7 am
 
@Raynos: good catch, good question. I only survive because we got 100% flexible working time
 
your gf is american?
 
no but she hates when I wake up 2 pm
 
3:03 AM
@jAndy is your company hiring?
 
hehe
 
@Raynos we have no patience for time/clocks
 
always, talented guys always welcome
 
@Esailija pro tip. Morning oral sex -> wake boyfriend up every time. if you teach her this, she no longer complains
 
I can work anytime I want, 8am-4pm , 4pm-12pm whatever
 
3:04 AM
 
but if I wake up at 2pm it means I can't do anything but work while she's awake
 
[ Machinae Supremacy - Force Feedback ]
 
well yeah but we don't live together ^^
 
@tereško if I said that was "very eastern european" in terms of music style would you hit me >_>
@Esailija heh, its 3am
I need to go
 
anyway I'm off to bed
remember, friends don't let friends use too much memory
 
3:06 AM
@Raynos actually it is swedish
and i honestly doubt that you have ever heard another "SID metal" band .. i havn't
 
I only listened to the introduction
 
bad for you
 
Woo! Finally got the CSS badge -_-
 
@RyanKinal I just realised you just became the local CSS expert
I will now forward any CSS questions to you, like I forward html questions to mattmcdonald and browser implementation questions to gsnedders
 
Works for me
I'm probably going to be writing some articles on CSS, though I have to organize my thoughts a little better.
So far, it seems I'm mostly parroting Nicole Sullivan -_-
 
3:17 AM
Nicole Julianne Sullivan (born April 21, 1970) is an American actress, comedian and voice artist. Sullivan is best known for her six seasons (1995–2001) on the sketch comedy series MADtv and five seasons (2001–2005, 2007) on the CBS sitcom The King of Queens. She has played a recurring character on Scrubs and voices the villainous Shego in Disney's Kim Possible, Drew from Cartoon Network's The Secret Saturdays, and Louise on the ABC Family series Slacker Cats. She had recurring voice roles on Family Guy and voiced "Franny Robinson" in Disney's Meet the Robinsons. From 2008 to 2009, Sul...
 
AH ok
@RyanKinal I think if you talk about CSS your site has to look "modern"
 
Hehe, I'm working on that
 
I can get away with talking about node / js without having a site that looks too shiny
 
Of course, I'm also building the blog engine, soooo... yeah
 
3:19 AM
I see
I see your pain
 
hehe
 
it took me forever to write my site with the blog infrastructure
even thought its a hello world web app we should be able to write in a day
@RyanKinal you could write it in VB.NET and WebForms 2.0 \o/
 
barf
... although, I'm writing it in PHP and PDO(MySQL) :-P
 
;_;
PHP.
Y u no choose node.js
 
3:21 AM
@RyanKinal looks like ass
 
Because I'm already pretty good at PHP, and it's more likely that I'll find a job using PHP than Node
@tereško I'm making improvements :-)
 
RAYNOS.ORG Y U DOWN
 
Scale fail? :-P
 
few tips : never use pure colors , especially not pure black and pure white .. and read about typography on web, your suck at it ( and no , this has nothing to do with choice of fonts )
 
Really? No pure black and pure white?
 
3:26 AM
it makes harder to read it
 
raynos is back up
@RyanKinal not scale fail. Just bugs. My code has very little edge case or stress testing
errno: 'Unknown system errno 110'
:D
 
@tereško [citation needed]
 
@RyanKinal personally I think your colour choices are too dull
 
sorry , its one of those bits of information for which i have no reference , but comes from credible source
 
I've seen worse :)
 
3:30 AM
@JeffreySweeney , you are on internet , of course you have seen worse
 
@Raynos I like simplicity. It's straightforward. I'll be adding a little variety in the form of images (based on how posts are tagged)
 
Perhaps adding a background color to your name would enhance it.
 
I'm gonna go with "no" on that one
 
At least the font isn't papyrus or sandscript
Or whatever those overused bad ones are
 
That reminds me... the next testing cycle at work will include Comic Sans as the main font. makes a note
 
3:33 AM
And yeah, simplicity reigns in the modern web. I'm done with trying to navigate novel UI with flash interfaces.
 
@RyanKinal implifying .gov sites are credible
Are these the same companies using activeX controls, ASP.NET 1.1 and IE6 ?
 
I don't think they have a hidden agenda to make the web experience terrible.. though I do see where you're coming from.
 
Fair point.
 
@RyanKinal , you do not need to believe me , but experiment with background/foreground colors in the shades of gray at least .. and play with line heights (in content ) and letter spacing ( in headings )
 
3:36 AM
It's that Basil Marceaux guy
 
you do not need a special font to make your site look good , even if it mostly contains text
 
Helvetica forever!
 
@tereško Yeah, line heights and letter spacing definitely need fixed.
 
and there are some other typography principles you might want to look into .. like "orphans" and "widows"
 
3:42 AM
So Ryan, are you making considerations as to how mobile devices will view your site?
 
Sort of. I don't have any mobile devices, so it's difficult to test. But the entire layout is percentage based, so it will at the very least scale with window size.
I'm, unfortunately, not well versed in mobile development :-(
 
Well, there's not much to it. Just make your browser window real tiny, and if you can still navigate fine, you're probably good :)
 
the least you can do is check you page in : opera.com/developer/tools/mini
 
Ooh, gonna test my site
 
@tereško Ooh, I was unaware of that. Thanks
 
3:46 AM
@tereško do you not find yourself spreading yourself thin focusing on design, front end and back end?
 
my knowledge in web design is only things i have learned in passing
i still have not finished reading "The Elements Of Typographic Style"
 
Well, my site's a disappointment... least it works on IOS and android...
 
btw , a really good book, especially since developers tend to make sites with focus on text instead of graphical decorations
 
Too true, especially now with modern devices.
I'm reading through that website Ryan linked to now.
 
@tereško I'll look into it
 
3:51 AM
in my experience , it has bitch to find
 
Wha? CSS3 gradients are out? Since when?
 
@RyanKinal , if you want , i can share the warez
 
@tereško Meh. It's under $20 on Amazon. I'll just buy it.
 

« first day (417 days earlier)      last day (4537 days later) »