Utterly Boring dot com

Cleaning PHP code is Fun

Really. I'm serious. At least in this case, it was fun, because I know now that it's done, my life will be a lot easier.

My work site is powered by PHP. The off-the-shelf script I used to power the home manager is called Free Realty. I'm using an older version of it where the code isn't as clean (and even the new version isn't as clean as it probably could be, but it's fairly plug and play). But the version I have used a TON of echo statements to create its various pages. Now, echo statements are fine if you're processing variables inside those echoes, but there were just large echo statements full of HTML, and it was just annoying to look at, especially so since HomeSite doesn't color code the HTML inside PHP tags -- meaning it's really hard to read. So today I got rid of a bunch of echo tags, did a lot more in-line PHP if/else stuff, replaced the longer echo blocks with short-tag versions of echo in-line with the HTML, reduced the amount of overall if/else statements and the code is a lot cleaner and easier on the eyes. It will make a future project I'm working on a hell of a lot easier, too (as I plan on reusing a lot of this same code).

I'm starting to pretend pretty well that I know what I'm doing with this stuff ;-) Prior to this job, I didn't know a damn thing about PHP, other than knowing a coworker or two were studs at it. But working here was the first real shot I've had at it, and it's a blast. Beats working on the piece of crap ASP server I have upstairs any day of the week.

Posted by Jake on 03/28/04 @ 05:43 PM
Posted in Jake | Permalink



What are you doing down here? Don't you have something better to do? Like Go Back To The Top of the page, or even see who created this site? This site is © 2001 - 2017 by the Utterly Boring folks at UtterlyBoring.com. Steal my content, as I probably did, too, just link to my site or the original site. Batteries not included. One size fits all. Not for off-road use. Not for internal use. Do not taunt Happy Fun Ball.