The (Under) Belly of the Beast

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:

  1. Liberal use of onClick="" for basically all links that weren’t form buttons. This is DHTML 4.0 event functionality.
  2. 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.
  3. 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?

118 Responses to “The (Under) Belly of the Beast”

  1. CHRIS says:

    exmoor pet care

    Buy_generic drugs…

  2. DENNIS says:

    low fat diets history

    Buy_drugs without prescription…

  3. JAY says:

    effexor xr 75

    Buy_generic pills…

  4. JEFFERY says:

    red wine and lipitor

    Buy_no prescription…

  5. JERRY says:

    protonix vs aciphex

    Buy_generic drugs…

  6. DUSTIN says:

    my rehab nursing clinical reflection

    Buy_drugs without prescription…

  7. MAURICE says:

    intravenous fluid heart rate

    Buy_drugs without prescription…

  8. TYLER says:

    buy@real.strong.armour” rel=”nofollow”>.

    Buydrugs without prescription…

  9. JULIUS says:

    ..

    Buyit now…

  10. RICK says:

    abilify@does.it.work” rel=”nofollow”>…

    Buygeneric meds…

  11. ALFRED says:

    aloe@ferox.gel.buy” rel=”nofollow”>.

    Buynow it…

  12. ANGELO says:

    aciphex@cancer.buy” rel=”nofollow”>..

    Buygeneric drugs…

  13. EARL says:

    calcium@coral.buy” rel=”nofollow”>.

    Buydrugs without prescription…

  14. VINCENT says:

    Buy@Discount.Aldactone” rel=”nofollow”>.

    Buydrugs without prescription xab…

  15. ALEXANDER says:

    Order@Aggrenox.Online” rel=”nofollow”>…

    Buyit now sge…

  16. TONY says:

    < a href="http://trig.com/advair7490/biography/?ml=Purchase-Generic-Advair-25mcg/50mcg-25mcg/125mcg-25mcg/250mcg-50mcg/500mcg-50mcg/100mcg-50mcg/250mcg Purchase@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250m

    Buygeneric drugs nih…

  17. AARON says:

    Purchase@Advair.Without.Prescription” rel=”nofollow”>..

    Buyno prescription jwi…

  18. FRED says:

    Purchase@Advair.Online” rel=”nofollow”>..

    Buyno prescription jui…

  19. RICARDO says:

    Buy@Cheap.Advair” rel=”nofollow”>.

    Buygeneric drugs hwi…

  20. DWIGHT says:

    Buy@Generic.Actonel.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs ouw…

  21. DALE says:

    Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>…

    Buyit now knc…

  22. MARION says:

    Cheap@Aciphex.Online” rel=”nofollow”>..

    Buyno prescription gdt…

Leave a Reply

You must be logged in to post a comment.