:: home
:: mobile
:: rss feed
:: twitter
:: archive
:: donate
:: about
:: bend blogs
:: cheap domains
:: welcome to
bend |
|
|
|
|
UtterlyBoring.com is produced by Jake Ortman (e-mail, resume), a 33-year-old dad, percussionist, sysadmin, Web developer, IT consultant and jack-of-all-trades geek, living in Bend, Oregon. He created this so that his expensive journalism and technology degree isn't getting totally wasted. In addition to editing this site in his free time, he is the service manager at Weston Technologies. He has LinkedIn and Facebook profiles if you're trying to stalk him. He will not be posting on Twitter.
Opinions and comments on this site are the opinions of the author, not the author's employer, family, friends or pets.
This site is powered by Movable Type and is hosted by orty.com. Since December 1st, 2002, there have been 6474 entries. Visitors to this blog have posted 21202 comments.
If you're reading this, you have too much time on your hands. |
|
|
|
|
|
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.
6 Comments
Jon said on 03/28/04 @ 11:41 PM: Sounds like a good start, but take it a step further: templates, man, templates.
:)
Jake Ortman said on 03/29/04 @ 09:57 AM: Step ahead of you :-)
I used template-like includes for every site I do, including this one.
Jon said on 03/29/04 @ 02:03 PM: Excellent....... :)
Hervard said on 04/23/04 @ 07:59 AM: It's good when you learn new things like this, and get paid to do it. Sounds like me with a job that I had. I was required to build a database-driven news site, so I taught myself PHP/MySQL and made it. I think I had a whole bunch of echo statements, heh.
Jeff Wilkinson said on 04/19/05 @ 07:33 AM: since you use homesite, have you gotten any of the extensions for php from my php4hs site?
(www.wilk4.com/asp4hs/php4hs.htm)
Other user wrote 'em, and many are pretty handy. (and free)
Jake said on 04/20/05 @ 11:38 AM: Jeff: I had not, and will be downloading them. Thanks!
Post a comment
|
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 - 2013 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.
|
|