I kid, I kid.
Last week I posted a thread on HackerNews asking why the website used tables for layout. I even noticed they were using the <center> tag.
http://news.ycombina...item?id=4370206
It seemed so strange to me that a website that is so cutting edge for developers would use web constructs plucked right out of a geocities website.
All HN needed now was some spinning skull GIF's and it was Angelfire City.
This morning was a slow day at work so instead of walking around the office I decided to rewrite the Hacker News website using HTML and CSS - the right way. (Or so I tried! - If I screwed up let me know!)
http://jsbin.com/ewufof/3/edit
The reason behind this was a commenter in the original HN thread that asked what the point was behind not using tables. "Tables just make it look right and is easier to position." The age old argument. Granted, he said he wasn't a web developer; he was a more down to the metal developer, wrestling with C on embedded systems.
Since he (and so many others) are all about the numbers, how's this for a number:
Original HN website: 26087 characters long.
My rewrite: 3587 characters long.
That is some massive savings. This will not only be lighter down the wire, but the browser will render it faster because it has less to do.
And it can be made even shorter with some more advanced wizardry.
The point I'm trying to make is that using <table> elements for layout is bad and you should feel bad for using them. If you tried modifying something in original HN it would take a long time.
In my example, just change some CSS rule and it'll ripple to all that apply.
Do you think you can make it any shorter?
Last week I posted a thread on HackerNews asking why the website used tables for layout. I even noticed they were using the <center> tag.
http://news.ycombina...item?id=4370206
It seemed so strange to me that a website that is so cutting edge for developers would use web constructs plucked right out of a geocities website.
All HN needed now was some spinning skull GIF's and it was Angelfire City.
This morning was a slow day at work so instead of walking around the office I decided to rewrite the Hacker News website using HTML and CSS - the right way. (Or so I tried! - If I screwed up let me know!)
http://jsbin.com/ewufof/3/edit
The reason behind this was a commenter in the original HN thread that asked what the point was behind not using tables. "Tables just make it look right and is easier to position." The age old argument. Granted, he said he wasn't a web developer; he was a more down to the metal developer, wrestling with C on embedded systems.
Since he (and so many others) are all about the numbers, how's this for a number:
Original HN website: 26087 characters long.
My rewrite: 3587 characters long.
That is some massive savings. This will not only be lighter down the wire, but the browser will render it faster because it has less to do.
And it can be made even shorter with some more advanced wizardry.
The point I'm trying to make is that using <table> elements for layout is bad and you should feel bad for using them. If you tried modifying something in original HN it would take a long time.
In my example, just change some CSS rule and it'll ripple to all that apply.
Do you think you can make it any shorter?
1 Comments On This Entry
Page 1 of 1
Martyr2
13 August 2012 - 09:36 AM
Eh... normally I would agree if browsers around the world would agree to follow the CSS standard. Not until recently have all the browsers pretty much gotten on the same page about CSS. Even as little as a year and a half ago most browsers couldn't agree much on CSS and I would have argued that limited table use for layout was acceptable.
The way things are moving now I would imagine no one needing to use tables for layout in the next year or so. But in the time being I would let some websites slide... especially if they are large and would require a lot of resources to convert.
The way things are moving now I would imagine no one needing to use tables for layout in the next year or so. But in the time being I would let some websites slide... especially if they are large and would require a lot of resources to convert.
Page 1 of 1
Trackbacks for this entry [ Trackback URL ]
1 user(s) viewing
1 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
About Me

Bienvenidos! I'm a USA ex-pat living in Bolivia for the past 10 years. Web development is my forte with a heavy lean for usability and optimization. I'm fluent in both English and Spanish. I guest write for the popular Python website Python Central. Visit my website.
My Blog Links
Recent Entries
-
DevOps for dummies - VPS Configuration from scratch - Rails, Nginx, PostgreSQL.
on May 22 2013 02:36 PM
-
-
-
-
How to create a signature form for iPad and mobile devices using HTML5 and Canvas.
on Nov 27 2012 08:15 AM
Recent Comments
-
-
Lemur
on Yesterday, 04:53 PM
DevOps for dummies - VPS Configuration from scratch - Rails, Nginx, PostgreSQL.
-
laytonsdad
on Apr 30 2013 11:30 AM
Dream.In.Code Badge Generator! Share your flair on your site or blog.
-
-
Jstall
on Nov 04 2012 09:18 AM
The Pragmatic Bookshelf mega blowout sale - 40% off select Ruby on Rails books.
Categories
|
|



1 Comments








|