Archive for December, 2007

Ad Hominem in article on Chernobyl

Tuesday, December 18th, 2007

Part of my original motivation for starting this blog was to find examples of logical fallacies on the internet. Search engines like Google and so on are great but, as far as I know, humans are still the best at finding logical fallacies in texts.

In an article on wildlife returning to Chernobyl:

Chernobyl: Lost world

the journalist introduces a scientist this way:

But this has cut little ice with Anders Moller, a controversial Danish-born scientist who was once accused of scientific misconduct in his home country.

The journalist doesn’t suggest that the misconduct that the scientist was accused of has any bearing on his current line of enquiry. Or whether the accusations were well grounded. But how can we now take anything that this scientist has to say fairly? This seems to be a form of an argumentum ad hominem

D on the Web

Thursday, December 13th, 2007

I took a look at the D programming language today:

I admit that I’m a sucker for new programming languages but this one looks genuinely useful. Nice object oriented programming, compiles to machine code, garbage collection and a lot of of other useful features.

Part of the reason that I like to look at other programming languages is my frustration with PHP, which I spend most of my days writing. I like PHP a lot and can churn out scripts at quite a rate. People often criticise the language because it’s possible to write spaghetti with SQL followed by PHP followed by HTML, all next to each other in the same file. Programmers can be lazy with any language. With care and time (admittedly more time than most deadlines allow) it is possible to write high quality, professional, object oriented code either from scratch or (more likely and perhaps better) by refactoring the script that you cobbled together in an afternoon and have found to be useful.

My problem with PHP is that I’m not sure that refactoring your rough drafts (the SQL/PHP/HTML brain dumps) to PHP goes far enough. Your refactored code might be more maintainable and allow reuse but it probably won’t run quite as quickly. Also, PHP’s very permissive syntax (whilst useful for the hacked code I mentioned earlier) allows for some very hard to find bugs in larger programs spread across lots of files.

One solution might be to use JSP. I used to write Java at work and found that it was a real nuisance (compared to the PHP, Perl and JavaScript that I was also writing at that job) to write at the early exploratory stages of a project but great once the major pieces had fallen into place and everyone knew what was what and where things ought to be.

But I like to consider all the options.

Some folks like to write extensions to PHP in C or C++. This always seemed like quite a sensible thing to do. In my mind, ultimately every program should make its way (albeit slowly) to native code. PHP is olften described as glue linking lots of native libraries. There’s no reason why libraries of PHP shouldn’t evolve to native libraries.

But C and C++ have their problems and are in some ways lacking when compared to Java. Java’s interfaces are useful. D similarity to Java makes it look very interesting. The brief look that I’ve had of it suggest that it has all the safety features of Java (that are missing from PHP), nicer object orientation than C++ and native speed.

Has anyone got any experience of refactoring a large PHP program to D? What about writing CGI programs or native PHP extensions in D? Is it worth the effort?

Sad but true

Sunday, December 9th, 2007

I have to admit that I often feel this way:

I’m not sure how this can be alleviated. Will we have to break all problems down into ever smaller chunks so that how hyperactive brains and minuscule attention spans can cope? I guess that blogs and tools like, google calendar and wikis (and the rest) will save us from the need to have memories or attention spans.