I'm converting that Perl code I've been writing to Python, since I'm writing a library I want to be available in lots of languages. Python is such a joy. It's so funny because most of the conversion from Perl to Python is simply removing things.
For instance, I just converted:
$self->{line_count} = scalar(@{$self->{lines}});
into:
self.line_count = len(self.lines)
Look how much nicer that is 
And again...
#key
$_[1] = $self->trim(substr($_[0], 0, $n));
#value
$_[2] = $self->trim(substr($_[0], $n+1, $len-($n+1)));
turned into:
key = str[:n].strip()
value = str[n+1:].strip()
(I think that's right). And trim was defined to be this:
sub trim{
shift;
my $string = shift;
for ($string){
s/^\s+//;
s/\s+$//;
}
return $string;
}
Ok, well I finished converting that code. I haven't run it yet, so there are definitely errors, but I don't think it would significantly affect the fact that just after doing a braindead simple port of the code from Perl to Python I went from 287 lines to 225 lines.
Ok, take it back. I thought you could do more inline in Python than you can actually do. So, that expanded it to 235 lines, and now it compiles
Still a big improvement.
While Perl has a lot of stuff built in to make a programmer's job easier (such as automatic memory management, etc.), for some reason I find it extremely hard to program correctly in Perl. It seems like, for me, it's much harder to get things right in Perl than in PHP or Python.
God, and I'm having to cut and paste large sections of code just so I can replace braces {} with brackets [] because Perl's syntax changes based upon the type of a variable, which is just wrong.
Well, it seems that judicious use of references can alleviate that particular problem...
Answers in Genesis: Anthrax and antibiotics: Is evolution relevant?.
Worth a read. Obviously its focus is on bacterial resistance to antibiotics, but the article contains lots of info that is relevant to the discussion of evolution in general.
I've seen this in a bunch of places, and I first came across it a relatively long while ago, but I didn't blog it because I wanted to read it first to see if it's worthwhile. I haven't finished it, but from what I've read it's definitely worthwhile, at least because it'll make you think about the issues the paper raises.
From Microsoft Research: Unifying Tables, Objects and Documents (PDF)
The most important current open problem in programming
language research is to increase programmers productivity,
that is to make it easier and faster to write correct programs[36].
The integration of data access in mainstream
programming languages is of particular importance - millions
of programmers struggle with this every day. Data
sources and sinks are typically XML documents and SQL
tables, but they don't merge nicely into a statically typed
object-oriented setting in which most programs are written.
This paper addresses how to integrate tables and documents
into modern object-oriented languages by providing a
novel type-system and corresponding language extensions.
I hate PHP
Elliot Anderson,
Dude!! You theman! The reverse replacement forarray_u...
Alex Ndungu: Oct 11, 1:35am