Re: [JSMentors] JavaScript architecture

2011-07-12 Thread Poetro
2011/7/12 dtang85 dtan...@gmail.com: Over the past year I've been focussing on JS and one thing that I haven't seen too much about is how developers architect their JS for small and large sites/applications. I've been primarily using the Publish/Subscribe pattern based on my own custom

[JSMentors] Re: JavaScript architecture

2011-07-12 Thread dtang85
@Poetro : I do namespace my PubSub object and it has publish, subscribe, and unsubscribe methods. You can take a look at it along w/ a demo on my GitHub account: https://github.com/skaterdav85/Publish---Subscribe-object I guess my concern is that as my application grows, it will look like a

[JSMentors] Re: JavaScript architecture

2011-07-12 Thread austincheney
I have an architectural pattern that I use to accomplish the only two objectives that matter: 1) Speed of execution 2) Ease of maintenance In my opinion absolutely everything else is, with one exception, irrelevant. You can evaluate whether or not software is crap with this simple formula: x =

Re: [JSMentors] Re: JavaScript architecture

2011-07-12 Thread Juriy Zaytsev
On Tue, Jul 12, 2011 at 5:54 PM, austincheney austin.che...@travelocity.com wrote: [...] 3) I ALWAYS use anonymous functions assigned to variables. There was some quote that went around from Brendan Eich that the function is too long and makes functional coding diffecult to read, but because

[JSMentors] Re: JavaScript architecture

2011-07-12 Thread austincheney
I didn't catch the reasoning behind using anonymous function expressions. Is it to ease refactoring in the future (when moving chunks of code around)? Three reasons. 1) The functions then become associated with named variables, and so they are then consumed by my point #2. 2) JavaScript is