This is a read-only archive!

PHP makes me sad; programming makes me happy

My other site is about Final Fantasy (the original video game of the series, for the NES). That site is how I learned HTML, a good 7 years ago. It's still my baby and (perhaps sadly) one of what I consider my greatest accomplishments. I wish I had more time to work on it nowadays, but such is life.

Oh how the internet has changed. I started out on that site with plain old static HTML files. It used to take me months to do or change anything. Eventually I learned about server-side includes and I started using those. A few years later I delved into PHP and started using it as a more sophisticated "include" mechanism and templated a good bit of the site.

Fast forward to today, and I'm trying to get most of my data in a mysql database. I learned a lot from work about how to properly design a database. That part I think I did pretty well at, on my FF1 site. The PHP frontend is where I started having problems. PHP is just such an un-fun language to work with. I hear PHP5 is nicer than PHP4, but PHP4 is what I'm stuck with. At first I tried a purely functional solution, and it very quickly become such a tangled mess of spaghetti code that it was nearly impossible to use. Today I rewrote that crap using the extremely weak OOP constructs PHP4 has to offer, and weak though they may be, my code is ten times shorter and probably ten times easier to read.

Sometimes I'll be sitting here banging out code, and it will be not working. The grunt-work of programming is debugging. You write something you think will work, and 10 times out of 10, it will fail the first time. So you find the first bug, fix it, rerun it. Failure. Find the next bug, fix it, run it, failure. Find, fix, run, failure. And you repeat this over and over and over. But eventually you hit that point where you find the very last show-stopper bug, and you fix it, and run your program, and it all of a sudden it WORKS. You almost never expect it to work. Success flies out of nowhere and hits you in the head, and it's really exciting. You get screen after screen of delicious output, all thanks to that last little tweak. That's the moment that makes the slog of computer programming all worth it.

November 24, 2006 @ 12:21 PM PST
Cateogory: Programming

1 Comment

Sander Knopper
Quoth Sander Knopper on December 05, 2006 @ 4:26 AM PST

I just wanted to let you know that there is a pretty good PHP webdevelopment framework called CakePHP which works good with PHP 4 as well. For more info see: http://www.cakephp.org/

For the record, no, I'm not affiliated with them or anything... ;)