One habit I have when visiting websites is to look at their codebase, both for curiosity and for new/interesting code snippets. Today, I was going through Facebook’s code while playing Mafia Wars and, aside from the sheer volume of code, a few things that sort of surprised me:
- Liberal use of
onClick=""for basically all links that weren’t form buttons. This is DHTML 4.0 event functionality. - Hundreds of lines of internal stylesheet classes, prefix-named according to a specific user id or session. For Mafia Wars, they preload all the possible classes used for any of the (currently) 3 locations you can explore. It’s never easy to have nice, clean, always external css, especially with a site this massive.
- About two dozen calls to external javascript and css files, all from the same server. They must have serious bandwidth
Granted, these aren’t by any means a knock against their coders. I’ve been fascinated by the sheer amount of data that goes between user and server for the Zynga games. It’s a feat in itself to command that much dataflow and event triggers and have a (mostly) stable environment for the user.
Plus, considering how long the site’s been around, there’s a lot of legacy code that’s most likely too difficult to extract to make the site work more efficiently. They would benefit greatly from using a JavaScript framework like jQuery, Prototype or MooTools, but trying to retrofit this into their current framework would be a bear, and quite frankly, is it worth it?
postnatal doctor visit costs…
Buy_generic drugs…
free fast diet tips…
Buy_generic meds…
keynesian economics great depression…
Buy_generic drugs…
autoimmune hepatitis glyconutrients…
Buy_generic meds…
johns hopkins lung cancer…
Buy_drugs without prescription…
boniva and bone thinning and breaks…
Buy_now it…
menopause thyroid cancer…
Buy_without prescription…
food and drug regulatory…
Buy_it now…
shampoo for people with dog allergies…
Buy_now…
psychotic depression and philadelphia…
Buy_generic meds…
twin pregnancy obstetrician specialist dallas…
Buy_drugs without prescription…
mycotic aortic abdominal aneurysm…
Buy_it now…
colon cancer systems…
Buy_now it…
most effective antibiotics strep throat…
Buy_no prescription…
allergic reaction to topical miconazole…
Buy_generic meds…
diets and blood type…
Buy_drugs without prescription…
sphenoid sinusitis causes double vision…
Buy_it now…
treatment of melanoma and vaginal cancer…
Buy_generic drugs…