Thursday, August 13, 2009

Creating a Splash Page in WordPress

Earlier this week one of my clients asked me for help on creating a splash page for a blog they where setting up. I of course said sure and figured it would only take like 2 minutes. Sadly, that wasn't the case there where a few issues that we ran into:
1) The way the blog was setup the urls looked like /?cat=16 instead of url-friendly
2) There was no way to specify a default blog page
3) The client didn't want to move the blog to a sub-folder (understandably)

The first solution I had was to set the default page but without modifying WordPress itself some of the links would just return you to the splash page. After a bit of messing around with .htaccess I finally came up with these two lines of code:


RewriteCond %{QUERY_STRING} !.
RewriteRule ^$ /splash.php


Basically what it says is if there is no querystring specified and the url is an empty string go to the splash screen. That is it and it worked!

Labels: ,

Saturday, August 01, 2009

What do you suck at when you develop code?

Everyone has a weak spot or a place they suck when doing any task, hence catch-all phrases like "no ones perfect". Since I am a developer I tend to look at development practices in general to see what could be improved or things that constantly happen to other developers. One thing I find interesting is how people cope with the thing they suck at the most. For instance I tend to rush things. Sure I get the code done quickly but usually it comes at the price of not fully testing the code I have written and bringing bugs into the system. If I remind myself to slow down then less bugs show up, shocking I know :). But what about other developers and the issues they have? I have seen all sorts of things like:
- Not seeing the forest from the trees
- Not taking the time to think of code maintenance down the road
- Not caring about usability

So, how have different people coped with the issues? I feel there are a few different ways you can cope with any short-coming you may have they are:
- Use a tool that helps you gain strength in a given weakness
- Find a buddy that is strong in your weak area
- Avoid the area like the plague
- Ignore that you have a weakness and think you are perfect :)
- Try to improve in that area

Use a tool that helps you gain strength in a given weakness:
This is a pretty good way to solve the problem if a tool actually exists and it works with your workflow. It is pretty rare to find such a tool for your given problem though but since we are a developers you can always just write a tool. For example if you tend to create lower quality code that is sloppy using a tool like FxCop could help increase your overall quality.

Find a buddy that is strong in your weak area:
What we can't just do stuff in a vacuum? Having this as a solution rocks but can also be difficult since you have to find someone that also meshes with your personality and has the time and want to help you. Hopefully their weakness is your strength so both of you can tradeoff in helping each other out. I have seen this work before but it seems fairly rare. Also, besides finding a buddy you can always hire someone to cover your weakness. For instance in my case it would be possible to hire a software tester to find issues on my code to minimize bugs that get sent to clients.

Avoid the area like the plague:
This is one of the simplest way to fix an issue you suck at. But it is also not always possible or it could be very self-limiting. For example if you create very poor UIs then maybe hand that off to the weird design dude that loves his mac and prefers doppios over that tall skinny soy latte.

Ignore that you have a weakness and think you are perfect:
This is like buying a mirror to make you look slim when you weigh 600+ pounds. Sure it makes you feel better but it can be annoying and disastrous. Sadly this seems to happen with a lot of people.

Try to improve in the area you suck at:
I personally believe this is the best solution but it is also the toughest. Trying to fix the issue you might have will take awhile and you have to remember to get back on the horse when you fall off. Some things I have read and done to fix pitfalls is by reading about the topic, consciously remembering the issue and catching yourself when you get into your old ways and having someone there remind you when you mess up.

I am sure there are other ways to fix being sucky at certain things so if you have a few ideas feel free to chime in :).

Labels: