Mon, 13 Aug 2007

TechCrunch has a story about how the PHP source code to Facebook's front page was leaked (by an Apache configuration bug, apparently).

The write up goes right into rather breathless speculation about it:

The first (ramification) is that the code can be used by outsiders to better understand how the Facebook application works, for the purposes of finding further security holes or bugs that could be exploited.
...
The second implication with this leak is that the source code reveals a lot about the structure of the application, and the practices that Facebook developers follow.

This I find amusing, as you can infer very little from just the front page of a site. The front page is normally a complete one-off from all the rest of the pages. It's unlikely that it implements any important functionality that could be exploitable. Furthermore, the architecture of Facebook could probably only be described in many pages of written English. The code here would only reveal a small fraction of it.

But even though I don't think this "leak" is anything important, I do enjoy seeing code from such a large website. It gives you a brief glimpse into what the actual work they do is like, in all its messy hackiness, something you otherwise never see.

Given all that, I've decided to "leak" the source code to the front page of rogueamoeba.com, right here (it's even less interesting than Facebook's). But perhaps you'll enjoy seeing it.

Posted by Quentin | Permalink | View/Post Comments (7)

Comments


WD
Tue Aug 14 19:08:07 2007

TABLES???



please say it aint so!

Paul (Rogue Amoeba Staff)
Wed Aug 15 10:54:34 2007

This is something I love about HTML and the web. There are very, very few hard and fast rules, so when people hear one, they cling to it. "Don't use tables for layout", we're told, and if you do, you get hysterical reactions like this.

But the site loads and renders fine, and quickly. Sadly, the rule of "It's best to minimize use of tables, and use CSS for layout in more cases" doesn't sound nearly as sexy as "Don't use tables for layout!".

Lucius Kwok
Thu Aug 16 19:21:10 2007

I don't get what the problem is with tables. I guess I'm more pragmatic than dogmatic, and if works for your target audience, who cares?

I just use WordPress.

huxley
Sat Aug 25 20:50:15 2007

Paul, there are many rules, the thing is that browsers are very forgiving. Some people do get a bit fanatical about HTML/CSS, but it's not so different in the programming world.

Think of table layouts in HTML as the equivalent of spaghetti code embedded in the GUI. Sure it gets the job done,  but you probably try to avoid doing it "the wrong way." Thousands of apps are written "the wrong way", but if you were advising a young programmer, you'd probably encourage them to "do it the right way", to learn good programming habits, wouldn't you?

With the web the problem is that because of older browsers, it is still a pain to do layout the "right way". That doesn't excuse people giving you a hard time about your layout though.

@Lucius

Some people care about it because they like to be puritanical prigs and put down others. Others however care because they take pride in their craft and would like to share a better way with others.

Amin
Mon Aug 27 07:34:11 2007

It's interesting that there are always hysterical reactions to almost anything that happens on the 'net.

Some code gets shown and already the sky is falling. You use tables and you're a bad influence.

The truth is that there is room for so many different points of view.

Usually, and this is just my opinion!, those who seek to denigrate others about what they do are often in need of getting out more and making some friends.

'nuff said.

Lane Robinson
Mon Aug 27 13:15:09 2007

First of all, seeing your front page source code, I now know all of your secrets for your application binaries.  I just do. Be paranoid!  :P

Use tables if that's all you can manage, but don't be proud! There are great advantages to avoiding them for layout that I won't bother repeating here. And you know what? It's actually easier to code when you use css for style and layout.  I remember when I finally made the switch to dump tables for layout.  My code became smaller, faster, more elegant, easier to read back, and also faster to write.


What's the equivilent of using tables for a sound application?  NOP's to pad out a loop for timing? :)

Paul (Rogue Amoeba Staff)
Wed Aug 29 15:38:28 2007

Lucius: I'd agree with pragmatism, though the counter-argument is that ultimately CSS will turn out better. I don't buy it though, not in all cases. If we were making the page from the ground up, and just learning, then sure, CSS. But we know HTML and tables, and the page has evolved over years.

huxley: Certainly the "right" solution is what to advise, but as noted above, we're not a blank slate. Not using that "right" solution doesn't need to result in hysterical reactions. It's just HTML, it's not the end of the world if we have a table for layout. Life goes on. 8)

Lane: You stay away from our binaries! Anyhow, I don't think we're "proud" of tables, we're merely content. Does it work? Yes. We use CSS all over the place, but it's not always the perfect solution. Do any of the advantages CSS offers for layout really buy us much when this already exists? Nah, not really.


This post is archived, and commenting has been closed.