Tuesday 7 December 2010

Python : Very First Impressions

Currently I'm reading Richard Dawkin's 'The Blind Watchmaker' and I'm going to have a go at writing programs -at least for the first problem of evolving one string to match another. I have decided to use Python, partly because, of the main scripting languages, I have already tried PHP, Perl and Ruby -hell people have actually paid me to write code in all of  them! Partly because it seems to be having a bit of a renaissance at the moment (and, who knows, someone might pay me to code in Python).

After one morning, I'm feeling OK. Fortunately I'm old enough to have used ten or fifteen different languages from the original BASIC (seventeen reserved words, all variables are one letter and maybe one number) , via Occam to Prolog.

So far the main differences from PHP are ones of syntactic suger :
  • Indenting rather than bracketing for loops and funtion definitions.
  • You don't need ';' at the end of a statement.
  • 'def' rather than 'function' to define a function.
  • richer and stricter typing -I'm not sure how I'll get on with this.
I have lots more to look at -I haven't got near the object model yet- so I'll post more later, either on this post or on a new one.

No comments:

Post a Comment

linkedin