Development Bits

Posted in: Development

I thought I’d share a couple development ideas I’ve been using recently recently. I’m interested if others think these are good ideas or if there are reasons to avoid them.

  1. In the next release of my Tasks software I’m appending the software version number in a query string for all JS and CSS files (file.js?version=1.2 instead of just file.js). The reason I’m doing this is to avoid situations where people have trouble refreching their browser’s cached JS and CSS files after upgrading the software to a new version. The only potential problem I can see with this is the argument in the URL might cause some browsers not to cache the JS and CSS. Insights?
  2. When creating a string in a format like this in PHP (please, no semantic tagging arguments):
    Item 1 | Item 2 | Item 3

    I put each item into an array, then implode the array with the ‘ | ‘ as the separator. This way I don’t have to check for the last item and exclude the separator - it takes less code and is a lot easier to maintain.

Any small gems you use that you think the world should know about? Comments and (especially) trackbacks with tips of your own would be wonderful.

Popularity: 2% [?]

Posted October 15th, 2004 @ 6:25 PM

One Reply

  1. Ian Landsman's Weblog adds this Trackback:

    Development Tips
    Alex King posted a nice tip I use alot about imploding an array to make a separated string without having to worry about having an extra separator left on the end.

    One thing I’ve noticed alot in PHP is people not initializing their variables. I’m…

    October 16th, 2004 at 10:29 am

Add a Comment

Please note: Use of a non-personal web site or blog in the field below and/or comments that are off-topic, personal attacks, or support requests will likely be removed at my discretion.

Note: This post is over 4 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

Around the web » « Revise Media Offers WordPress Hosting

About This Site

This is the personal web site of Alex King, a web developer in Denver, Colorado USA. More...


Crowd Favorite

Crowd Favorite is my software and web development business.

We build web applications, design and develop custom WordPress themes and plugins, and build custom sites using WordPress as a CMS.


I also have a tumblog that aggregates my online content from other services (Twitter, Flickr, del.icio.us. etc.).

America

Ads

Get Group Health Insurance
Car Loans available here