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.
- 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?
- 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.