Apparently my entry regarding my decision to create my own weblogging software has attracted enough readers to cause quiet a few people to notice my complaints about cafelog. Mike thinks that I have been unfair in my evaluation, and he’s right. I was a bit harsh.
To be completely honest, my first draft of that post included something along the lines of “One thing that can be said for b2 is this: It works and it has plenty of users.” Somehow, through all of the editing and screaming at the use of pointless database queries, global variables, and some of the most difficult logic I have ever tried to follow, that little statement got lost.
The truth of the matter is this. I had looked at the code once long ago and was immediately scared by the ugly URLs. However, after seeing more and more people starting to use it, I decided to give it another shot and see if I couldn’t modify it to suit my needs. It was then that I saw how horrible the code is (on which, Mike agrees with me, at least in part).
I stated somewhere towards the top of the post that the features that Ifelt were missing “might actually exist in cafelog already, and I was just so unwilling to read every line of code written in order to see that”.
Is the code inefficient? Yes. Could it use a rewrite? Yes. Does it break almost every rule that “good programmers” attempt to install into the minds of others? Yes.
Is it a total piece of shit not worth using by anyone? No. Not at all. Would I use it as it is now? No. If the author agreed with my vision, at least in part, of how it should be, would I be willing to help make it that way? Absolutely.
Actually, one of the nice things about cafelog is that it is written horribly. Bear with me on this one. While programmers like myself start convulsing when we have to wade through such code, less experienced programmers actually like it, because it is easier for them to work with. Because the “template functions” are in the global namespace, they work anywhere. Because the data returned by the database is in a global variable, you don’t have to use any tricks to get at it. It makes extending, enhancing, and modifying the code easier for newbies.
I still think it should be rewritten. However, examples and documentation should be provided to help unseasoned programmers get over the small learning curve that takes place when things like “classes”, “references”, and “function parameters” are used. When written cleanly and offered with examples, it can be made just as easy to modify as it is now.
I’d also like to thank Mike for being the first cafelog user to inform me that there is an easy hack for it that allows friendlier URLs and then actually find him using it.