Archive for May 4th, 2008

OOP and CSS

Since I'm working on a new PHP based project, I wanted to make a nice switch from the old methods I used to use... To cut the story short - it's OOP and CSS. "Object oriented programming" - not that high tech as one might imagine, but it doesn't let my PHP files turn into dusty code buckets, and it sure makes every piece of my hard written code reusable! In PHP - this basically means that you can create one class.php file that you will use to host your respectable code, and later on, you can call it on any page you find fit in a snap! Quite better than using plain libraries, since you can create multiple instances with your class and you don't have to worry about conflicting with any global variables or built-in PHP functions. Neat-o!

And as for CSS... Phew! It was a long way ahead! I'm glad it's over! For the first time CSS coder, the temptation to throw everything away and turn back to using plain old tables is very, very strong! And why wouldn't it be? Every WYSIWYG web design program let's you create tables in a jiffy, and organize them in any way you want, and with CSS, you have to ditch the GUI and work your way through <div>s and CSS properties. But, once you get past the first "position:absolute" line, you will see why this method of creating websites is really the most natural thing to do! You can position your DIV anywhere you want it to be! Tables are for data - that's it. They can't be moved properly and constrain your website to be nothing more than just plain flat, and once you start experiencing cross browser pains with tables (sure, they do exist for CSS, but in most cases, they are fairly resolvable) you will run back screaming. (trust me, the same table doesn't always look like it should in IE, Firefox or Opera, and there's nothing you can do about it)

Oh, and did I mention the feeling that most people get when they write something down in a PHP/HTML + CSS file and it works beautifully the way it should? Magical...

Well, there you have it... If I didn't make these switches, I'd be stuck with Cobol right now ;)

1 comment May 4th, 2008


Calendar

May 2008
M T W T F S S
« Apr   Jun »
 1234
567891011
12131415161718
19202122232425
262728293031  

Posts by Month

Posts by Category

Blogging links