Archive for March, 2008

Karsten Wagner on Static Typing

Thursday, March 27th, 2008

This expresses more eloquently what I wanted to say (and then some…) the other day when writing about PHP and C#.

http://kawagner.blogspot.com/2008/03/static-vs-dynamic-typing-part-2.html

It seems that there are quite a few people who are less than enthused by dynamic languages. I guess that we can never have too many programming languages…

DB Pages Plug-in using Haddock OO SQL Queries

Thursday, March 27th, 2008

I’ve gotten the DB pages plug-in for Haddock CMS to start using the new OO SQL queries that are in the core.

Check out:

DBPages_FetchAllSectionsForPageSelectQuery.inc.php

It probably makes sense to check out the classes that this extends as well…

Getting the OO model of SQL queries to work has been something of an up-hill struggle. I’m sure to run into more bugs as more queries get written this way. At this point, it’s still considerably more work to write out a query in this way rather than just write it out with HEREDOCs. But ultimately, I think that this approach will pay off.

It certainly has with page, HTML and URL generation in Haddock CMS.

The Grass is Greener and the Dark Side of the Force

Monday, March 24th, 2008

Apart from eating too much chocolate, this Easter has given me a chance to do some non-work programming.

I’ve gone through some of the internal gubbins of Haddock CMS and worked on the classes that can be used to generate SQL statements. They need a bit more testing but they should make DB code a lot tidier.

I’ve also been playing around with Visual Studion C# Express Edition in order to get back up to scratch with C# for Coelacanth:

http://code.google.com/p/coelacanth/

I’m very impressed with the IDE and have thought for a long time that C# is a great language. In fact, I think that I like it more than any other language that I’ve used (Java, C, C++, Perl, PHP, Python, Ruby, JS, Prolog, POP-11, Star Basic, VBA, Bash and Script-Fu being the others). This is a bit of a problem for me as I have lots of compelling reasons not to give up PHP to use ASP.NET with C#.

An enormous investment of time in existing code being the main one. Having said that, this weekend’s coding with Haddock has reminded me of the limitations of PHP for object oriented programming. I’ve always liked statically and strongly typed languages and PHP’s looseness makes me worry a lot. When you spend an afternoon tracking bugs that would be caught by the compiler of a stricter language, the idea the flexibility in your language saves programmer time looks like a childish myth. Don’t get me wrong, there are cool OOP tricks that you can do with PHP, Perl, Python, Ruby and JS that aren’t possible with stricter languages. Perhaps this easy compilation phase is a good thing as it makes me test the running code more thoroughly.

Also, try comparing the offerings for PHP hosting with those for ASP.NET. You get a lot more bang for your buck in the LAMP world. If one provider doesn’t live up to your expectations, you can dump them pretty easily and go on to the next one. Although Lunar pages seem to have quite a good deal:

http://www.lunarpages.com/windows-hosting/

For a dedicated machine or a VPS, there’s really no comarison. Linux is miles ahead. Perhaps I should give mod_mono a go. Microsoft are getting into the Virtualization game in a big way. Are they going to go after the likes of Linode ($20 pm for a Linux VPS and 10 GB of disk space)? Hopefully they’ll launch a dumping campaign and start selling a version of Windows Server to be run as a guest OS at a studidly low price.

I guess that I’ll probably get to find C#’s wrinkles as I write Coelacanth. I’m not likely to stop working with PHP any time soon and I’m certainly not going to rewrite any of my existing sites. But playing with rival languages is very instructive.

Oedipus Drama Theoretic Analyser to use Haddock CMS

Wednesday, March 12th, 2008

The Oedipus Drama Theoretic Analyser is going to use Haddock CMS as its foundation.

http://en.wikipedia.org/wiki/Drama_Theory

The idea of the program is to help automate and manage drama theoretic analysis of plots.

Hopefully, Saul and I will find time to work on this project shortly.

Facebook Plug-in for Haddock CMS

Monday, March 10th, 2008

I’ve just been working on a new plug-in for Haddock CMS that will help write Facebook apps.

You can check out the progress of the code at:

http://haddock-cms.googlecode.com/svn/plug-ins/facebook-app/trunk/

Saul and I are refactoring a lot of code from an existing Facebook app into this plug-in so that we (and others…) can reuse the useful parts in the future.