Reply to post: Re: why python ?

Python 2 bows out after epic transition. And there was much applause because you've all moved to version 3, right? Uh, right?

ibmalone

Re: why python ?

Yes, Perl I still find better for general glue programming, largely because of its string handling, it's built for executing things and interpreting the output, no other language really is. Despite its reputation it's possible to write clean and readable Perl, you just have to avoid the temptation to use its implicit tricks too much.

On the other hand, Python library support is excellent, and it makes prototyping a lot easier than compiled languages; if I want to get an image and Fourier transform it in C I need quite a bit of boilerplate to use functions and structures from two libraries and then probably do some format munging to shovel from one to the other. In Python the slightly larger set of built in types and standardisation on numpy for numerical work makes it trivial, and if you know how to make good use of the underlying compiled libraries (e.g. numpy's tensor products) you can write things that compete with compiled code for speed (been meaning to look at Cython, but numpy is sufficiently good that it's not been worth it yet). It's not going to take over from C for really high performance stuff, all those handy types come with a cost, but sometimes development and prototyping time are more important (and I suspect to really be efficient it's worth taking the time to write the bits that need to be fast as C and wrap them up in python for the convenience).

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon