HN user

mrfabbri

21 karma

@mrfabbri: rather tough, rather nerd.

Posts6
Comments13
View on HN

Yep, you learn little by "writing code", you learn a lot by developing an ass kicking product/service in a very constrained environment, working with great people and pushing yourself to the limit. It's about the people, the [human] experience not just the code.

The code above doesn't provide a Singleton implementation, you can test it by using the expression mySingleton() == mySingleton() which should evaluate to true, while it evaluates to false. The problem is that the function returns an object literal but every time the function is called it creates a new one (i.e. {} == {} evaluates to false). You can find a sound definition of a Singleton in JavaScript which makes use of the (quite tricky) Lazy Function Definition here: http://stackoverflow.com/questions/1895635/javascript-single... . EDIT: Took a deeper look at the "book" and the singleton section and I think it somewhat misuses the term Singleton (or it uses in a "broad" sense): the example you reported provides some information hiding but no single instantiation restriction, which it is instead provided by the final example/iteration.

- E-mail/calendar/docs: Google Apps standard edition

- Hosting: DreamHost

- Analytics: Google Analytics

- Project management: Email (lots of), Google Spreadsheets

- File-sharing: WebDAV, Dropbox

- Version control: Mercurial

- Backups: rsync

- Istant messaging: GTalk, Skype

This mirrors my macbook setup [which I enjoy pretty much] with the external monitor: [mouse][keyobard][macbook trackpad] :-)