News for hackers. Stuff that matters.
Re:Javascript in Ten Minutes by axod on Sunday May 10, 2009 @11:13AM (#602163)

  1. You would keep a pointer to the span, in each ChatUser object.
  2. You would have *some* unique ID passed from server->client
     to identify which user its talking about. A session ID say.
     this could be used to lookup the ChatUser object.
>> "It's a contrived example, but I hope it illustrates the importance of associations. There are multiple workarounds for this situation. But they aren't elegant, which is why I think JS sucks :]"

Nope, and I actually think your proposed method - mapping ChatUser->span is incredibly ugly and inelegant. Horrible design. A ChatUser object should know what UI elements it is in control of directly.

Re:Javascript in Ten Minutes by tumult on Sunday May 10, 2009 @04:57PM (#602487)
Why? The original library does not deal with GUI at all. The ChatUser object does not need to know what GUI HTML elements it's associated with. One component of a piece of software extending another should not have to tamper with the original; this is just bad design in general, not OO or any specific flavor.
Re:Javascript in Ten Minutes by jetako on Monday May 11, 2009 @07:02AM (#603282)
Please read up on MVC before you write any more code, for the love of sanity.