Home > Uncategorized > The Met Office ‘climategate’ Perl code

The Met Office ‘climategate’ Perl code

December 25th, 2009 Derek-Jones

In response to the Climategate goings on the UK Meteorological Office has released a subset of its land surface climate station records and some code to process it. The code consists of 397 lines of Perl (station_gridder.perl and make_global_average_ts_ascii.perl).

At various times I have been asked to suggest which part of an application’s or product’s source code should be made available to a third party. The third party may have been interested in evaluating the quality, getting a feel for the complexity or felt that they ought at least be able to say they had seen some code. In these situations there is always a trade-off between impressing the customer (e.g., well structured code containing lots of comments) and not revealing too much (e.g., impenetrable code with no comments).

Have the Met Office released the code they have used over a period of time or have they release newly written code?

The source does not have the characteristics often seen in well worn, ‘old’, code. There is no revision history (that may be due to poor programming practices or may have been stripped off prior to release; I discuss pretty printing below), the visual layout is generally consistent (this may be because the same small group of people have worked on it over time), there are no obvious hacks used to get around previous design decisions that have changed and unscientifically it just feels to me like newly written code.

Was the original code written in another language (e.g., Fortran), perhaps as part of a larger program and been rewritten in Perl?

The code does not have a Fortran ‘accent’ to it. The code was written by people who are fluent in Perl; perhaps they do not know Fortran very well and were given time to craft something presentable, hence no Fortran accent.

Why have I been referring to the code authors, plural, when writing 397 lines is well within the capabilities of a competent developer working for a day (I bet the authors spent longer in meetings about this code than actually writing it)? Developers tend to have very fixed habits when it comes to bracketing statements with curly braces, there are those who always put the open brace at the end of the line and those who always put it on a newline. The Met Office code contains both usages, sometimes within the same subroutine. Also the use of whitespace around punctuators and operators does not follow a consistent pattern, which for me rules out the use of an automated pretty printer and kind of implies more than one person doing the editing. And why are some variables names capitalized and other not (the names in subroutine read_station are all lower case while the names in the surrounding subroutines are mostly upper case)? More than one author is the simplest answer.

One Perl usage caught my eye, the construct unless is rarely used and often recommended against. Without a lot more code being available for analysis there are no obviously conclusions to draw from this usage (apart from it being an indicator of somebody who knows Perl well, most mainstream languages do not support this construct and developers have to use a ‘positive’ construct containing a negated condition rather than a ‘negative’ construct containing a positive condition).

  1. Peter
    December 25th, 2009 at 15:29 | #1

    Given that it was written in perl, it should have been rewritten as a one-liner.

  2. December 25th, 2009 at 17:29 | #2

    The people who wrote these scripts may be “fluent in Perl” (whatever that means), but they are certainly no masters of the language, nor are they plugged into the general Perl community. There is no usage of CPAN modules (many of which would have made this code more comprehensible). There are several subtle bugs in the code and the code is unnecessarily imperative. While it may not be “Fortran-accented” (and I agree), it is definitely “C-accented”. (I would say “Java-accented”, but someone will argue that there aren’t any objects.)

    If I had to guess, this code was written by 3-5 developers who are conversant in several languages and prefer Java or C++ over most other languages (likely they have a large Java or .Net application to maintain and this is a side project). Someone decided that since this was manipulating text, Perl would be the best choice and everyone else just went along. The code has undergone at least 3 internal bugfix/upgrade cycles and possibly as many as 6+.

    And, finally, this code isn’t being released to the OSS community – it’s being released as a political maneuver.

    (Oh – Damian’s anti-unless screed is almost completely disregarded by the Perl community at large, at least as judged by CPAN authors.)

  3. December 25th, 2009 at 22:24 | #3

    I think the code is comprehensible as written and somebody who knows a language other than Perl could probably figure out what is going on. CPAN does contain lots of useful modules but when writing relatively small amounts of code, unless the developer happens to be familiar with a module that solves the problem at hand it is generally less effort to to write the required code. Not using CPAN modules also makes life simpler for non-PERL users who will not know about CPAN (here is one).

    The code does have a strong imperative feel to it. I don’t see this as being necessary or unnecessary, but then I am always less than impressed by the cryptic code much beloved of Perl aficionados. I see no C or Java specific ‘accent’, but then 400 lines of code is the briefest of conversations.

    Unless you have inside information the numbers in your second paragraph might just as well been delivered by Santa Claus.

    The release of the data is obviously driven by a public relations agenda and the code might just have been tagged on as an after thought. Perhaps a couple of Met Office web site developers had some spare time on their hands and decided to put something together.

  1. No trackbacks yet.
Comments are closed.
www.wenn.com
FireStats icon Powered by FireStatswww.tinynibbles.com generic levitra purchase

cheap viagra from uk

buying cialis soft tabs 100 mg

generic propecia alternative

buy propecia online

buy cialis cannada

cheap propecia online

ordering cialis gel

cheap viagra canada or india

cialis professional 100 mg

cialis fast delivery usa

buy now propecia

buy 5 mg cialis

healthcare canadian pharmacy

buying levitra online

brand name cialis overnight

brand viagra professional

lowest price for propecia

cheapest viagra

ganeric cialis

buy cheap levitra

cialis no prescription

brand name cialis

mail order levitra

generic viagra online

how to get cialis in canada

how to buy cialis in canada

best price for propecia

canada cheap propecia

buy levitra vardenafil

cialis on women

indian viagra

brand cialis for sale

cheapest price propecia cheap

buy levitra overnight

generic viagra canadian

cialis professional no prescription

cialis one a day

cialis and ketoconazole

order cheap levitra

cialis cheap us pharmacy

how much is viagra

info levitra

levitra prescription

cialis for woman

order levitra online

levitra 10mg

cialis generic 100 mg

online propecia prescription

mail order propecia

buy propecia online prescription

obtain viagra without prescription

canadian viagra

order cheapest propecia online

cialis 5 mg

cheap cialis

levitra viagra online

online cheap viagra

online ordering propecia

how to get viagra

lowest price on non generic levitra

generic cialis from india

cialis 100 mg generic

lowest cost levitra

discount generic propecia

indian cialis

discount levitra online

cialis price in canada

cialis from mexico

bio viagra herbal

cialis soft pills

generic propecia 5mg

cheap levitra uk

cheap fast levitra

buy levitra online no prescription

generic propecia online pharmacy

best price for generic cialis

buy viagra online

cialis strenght mg

lowest propecia prices

hydrochlorothiazide cialis

canadian viagra india

levitra online us

get levitra

cialis purchase

ordering propecia online

generic viagra india

levitra cost

cialis dosage mg

online viagra gel to buy

next day delivery cialis

does generic cialis work

levitra sales uk

once a day viagra

5 mg original brand cialis

cialis cheap

generic levitra cheap

cialis in mexico

canada meds viagra

cialis discount

cialis to buy

discount levitra purchase

cheap cialis from india

cost levitra low

buy cheap generic levitra

buy levitra online viagra

buy propecia online pharmacy

cheap levitra tablets

levitra now online

lowest priced propecia

canadian healthcare

cheap order prescription propecia

levitra tabs

canada levitra

cialis uk

cialis headaches

buying viagra in canada

cheap propecia 5mg

online levitra

natural viagra

canada viagra pharmacies scam

cialis daily dosage pharmacy

buy generic viagra india rx

buy cheap generic propecia

canadian pharmacies cialis

canada online pharmacy levitra

canadian viagra 50mg

cialis 20 mg

levitra in canada

cialis tablets foreign

generic propecia finasteride

levitra online sales

internet pharmacy propecia

buy viagra mexico

indian cialis generic

name brand cialis

order prescription propecia

get cialis

cheap viagra online

generic propecia sale

5 mg daily cialis

cialis 5 mg italia

cialis online

levitra in india

buy real viagra online

generic levitra canada

cialis vs levitra

order cheap propecia

order propecia

buy levitra us

buy viagra online cheap us

levitra next day delivery

lowest price levitra

canada propecia prescription

online pharmacy propecia renova

gele viagra

canadian propecia rx

cialis from canada

generic cialis next day shipping

cialis daily in canada

levitra online overnight delivery

buy propecia cheap

can i get viagra in mexico

canada viagra

how much to buy viagra in pounds

how much cialis

cialis transdermal

best price propecia

cialis next day

buy online prescription propecia

cialis delivered overnight

canadian pharmacy

buy branded viagra

discount propecia online

levitra pill

buy cialis usa

canadian healthcare pharmacy

canadian drugs propecia

online propecia prescriptions

cheap prescription propecia

overnight delivery viagra

buy cialis fedex shipping

online pharmacy propecia viagra

levitra for sale

online cialis

cheap propecia no prescription

cheap levitra without prescription

cheap canadian viagra

cheapest overnight cialis

canadian healthcare viagra

buy canada levitra

generic viagra made in usa

lowest price propecia

cialis professional 20 mg

canadian online pharmacy cialis

generic cialis soft tabs

cheapest viagra usa

generic levitra overnight delivery

cheap levitra prescription

canada viagra generic

combine cialis and levitra

cialis price

best price cialis

levitra mg

cialis and canada custom

canadian pharmacy cialis

buy levitra uk

levitra online

cheap cialis soft

buy discount viagra

cialis overnight

lowest propecia 1 mg

online propecia uk

cialis overnight delivery

buy propecia prescriptions online

buying cialis next day delivery

generic levitra online

fda levitra

next day viagra

cost of propecia

brand viagra over the net

generic cialis sale

discount propecia propecia

once daily cialis

buy viagra on line

canada online pharmacy propecia

levitra cheap fast

buy prescription propecia without

cost of viagra

generic viagra canada

levitra order prescription

buy dosages levitra

levitra mail order

buy propecia now

buy generic cialis

buy propecia online from usa pharmacy

cheapest propecia prescription

cialis prescription

buy can from i propecia who

how much does cialis cost

generic levitra vardenafil

discount cialis india

buy cialis in usa

buy cialis canada

cialis woman

order generic levitra

levitra low price

low cost propecia

get levitra online

cialis pharmacy

buy levitra online from canada

cialis price 100 mg

for sale levitra

buy cialis once daily

buying generic cialis mexico rx

generic propecia effective

generic viagra 100 mg

herbal propecia

generic viagra made in india

cheap levitra

canadian viagra and healthcare

buy cialis without prescription

mail online order propecia

discount us propecia

drug generic propecia

canadian pharmacy viagra

buying propecia online

cheap propecia online prescription

buy fast propecia

cialis next day delivery

levitra online prescription

low cost canadian viagra

online generic cialis 100 mg

buy propecia on line

cialis 50 mg

cheap discount levitra

mexico levitra

cost of daily cialis

overnight delivery cialis

buy cialis 5 mg

lowest propecia prices in canada

50 mg cialis

female viagra pills

cheap propecia uk

cialis daily

cheapest viagra online

order viagra or levitra

cialis refractory

best price levitra

discount levitra rx

buying generic propecia

buy cialis online canada

getting cialis from canada

canada generic propecia

daily dosage cialis

buy generic propecia

buy propecia generic

levitra canadian

buying propecia

buy cialis online uk