There is resistance to adding XS modules to all of our systems (there’s even resistance to adding pure Perl, though not as much).
Next time it comes around, I would revisit the ideas brian puts forth in http://www.effectiveperlprogramming.com/2011/09/enchant-closures-for-better-debugging-output/, as that will have less internal resistance and many benefits. One plus is that the enchanted closures can be tweaked for debugging purposes with little effort.
]]>
if test: i += 1
, no newline required. This is about the same as the Perl example.
For list comprehensions, nothing is preventing you from using line breaks to make things more readable:
values = [x.value
for x in list
if x.value > 4 and x.name != 'bob']
]]>
I think one reason why people think that Python is more readable is because it’s simpler. Both syntax and semantics are simpler. Less operators, less constructs, less ways of doing things. In practice this means that you can understand any Python code after an afternoon. While the same thing for Perl takes years.
Perl is a very flexible language and a good developer can write beautiful readable code with it. In my experience , however, most of the times that flexibility is used to write ugly code instead.
]]>So Perl v Python arguments centered around syntax are somewhat irrelevant. You will find godawful things in both of them.
For me, the only things that matter are:
(i) lots of powerful libraries (ii) good documentation (iii) helpful communities (iv) speed [for some things]
My main toolkit is made up of Perl, Python, Go, and C.
Perl nails (i), (ii), and (iii). It is the super-glue that allows me to write small programs that do a lot simply because just about everythig has already been written on CPAN
Python is the ants-pants for (i) which has anything to do with math/science/ml
Go is the only choice for (iv) for anything to do with concurrency
C is the closest human-readable thing to the metal, and I use it for (iv) where speed and size is paramount.
]]>