Programming without learning is perilous.
Posted on 02.09.2009 12:54 am
Today while working on the blog I felt something. An unease. I couldnt quite pinpoint what it was but I didn't like it.
So I decided to throw out and redesign some parts of the system.
Why?
Because at an early state of a program, you must be willing to stop, rewind and start over. Just like any other handywork. You feel like you're doing the right thing and when you're at a certain point, you know you've done a mistake that needs fixing.
Experience is knowing where to start so you don't need to stop and waste time fixing your mistake.
The blog system is not big. I have not had much time to work on it. But lately I've had even less time. So when I fired up the editor tonight, I knew instantly that I had done some things wrong.
Hopefully that's experience speaking.
What are some of the things done wrong?
The blog structure is messy. For example there are two controller files for a blog view (be it the main view or an individual blog).
- Lesson learned. Don't overthink things you have done a 100 times. Because for the 101th time, you can get it wrong. Stick to the things you know work.
The basic structure does not allow for a flexible template. For example parsing a template that uses another template is messy.
- Lesson learned. Templates are hard, let's go shopping
I naively thought having two view files (one for left and right content) would be a good idea. It's totally not.
- Lesson learned. When designing a system to be used by others. You should never design it to fit your needs alone.
Having a fancy url setup (mod_rewrite) from the start makes things annoying when I want to make changes in the overall setup.
- Lesson learned. Start with a classic url setup and then convert it. It's to late now though since I'm getting linked.
There are more but those are the main items.
But for me. Doing this is a good thing. Since this adds to experience. And hopefully I can pass that experience on to others reading this.
If you have any stories you'd like to share that are similar to this. Then I'd love to hear them.
1 7 Like it or hate it? - Comment (2)
Alex Rozanski
0 1 / Posted on 02.09.2009 07:51 am
That's an interesting point you make about mod_rewrite, or URL rewriting in general, since one of the advantages of using it is that your URLs can remain static even if the underlying page structure or technologies change. I'd never thought about it the other way round – and you could always change the page structure now (before the linking problem gets any worse) and have "legacy" rewrites to the new URLs, although that could get messy.Ólafur Waage
0 1 / Posted on 02.09.2009 11:01 am
One of the issues with the fancy url is that if you're original idea you setup is a bad idea. An example for me is /blog Thought it was a neat idea at the start but in hindsight its not.So yes, you could have a legacy setup but at this point it's not a good idea :D
Process time: 0.00964 seconds