4 ms·
Could you explain what features or aspects made it quicker to get up and running with? I love Python and have never worked with a language that I felt let me g
by d23 13y ago
Could you explain what features or aspects made it quicker to get up and running with? I love Python and have never worked with a language that I felt let me get features out so quickly. Do you feel you've sacrificed readability as well? I've heard Perl is notorious for having a million ways to do everything, making reading it hard.
- arghnoname 13y agoI'm not the OP, but I've had a similar experience and agree with him about Perl. For me... * perl is a bit more intuitive, even though I've done about as much python as perl at this point. * It's the best language for dealing with regular expressions in my view. You don't have to create a regex object and muck about with all of that. * You can create lambdas/closures with fewer restrictions than Python (this is a big one) * CPAN is pretty good. Python comes with a lot of libraries, so this isn't as much of an edge as it used to be. * It is more widely available on other servers, even older ones, which is important for me because I'll sometimes have to do work on a machine without Python already installed. I can work with older perl and I've never been on a machine without it installed. * The whitespace issue really is annoying to me. With braces you can move stuff in and out of conditionals, etc, easier than with Python, even with editor support. As for readability, I try to write reasonably well, even if in a hurry. I know the language and its syntax. I understand the purpose and meaning of the sigils, so it doesn't look like noise to me anymore than reasonably written python. In Python, for instance, I've seen list comprehensions that are pretty frustrating to puzzle through. Perl with strict and warnings and written without a specific aim to be clever isn't hard to read.
- ChuckMcM 13y agoperl is more connected to things flowing through it. In python I was often fighting with the subprocess module to get things plumbed but in perl it was trivial to open a process to a pipe and then put a process on the output of that pipe. Much of the code I've written here does analysis for bad actors (robots and such) and perls regular expressions have been easier to get right sooner. (although the naming of results in Python is quite useful). When I was at Google I started using Python to create a CMS of sorts for my toy website (robotics.mcmanis.com) which got to the point of being able to push some stuff but more complex stuff was a pain. So it sat there. Then rebuilding that with perl and the template toolkit it was a bit easier and I was much happier with the result. I still don't have a lot of time for it (like none for the last few months) but I got the framework for putting up a new "article" down to a pretty smooth process and managing all the internal links worked well. Perhaps it is that I programmed in C for so long that my synapses are more attuned to reading code with braces. But I find I can look at perl and intuit its function much more quickly than I can do the same for Python.
- Mithaldu 13y ago> although the naming of results in Python is quite useful I assume you mean named captures? C:\>perl -E "'abc1234asf' =~ /(?<one>\d+)/; say $+{one};" 1234 > template toolkit Please try Text::Xslate. :)
- ChuckMcM 13y agoI will look at Xslate. My simple system basically combined a markdown (with some enhancements) "base" document, with custom image tags and source tags. The current source to HTML mechanism used vim to do the syntax coloring, then dump out the html with ToHTML and then processed by the perl code to pull out the actual code. Given that I've been moving code over to github my plan for the future is just to pull gists into the HTML pages. To the extent that I can simplify steps with Xslate we'll see. It still takes too long to go from 'thought' to 'page' (and my 'schematic description' -> SVG (or PNG) schematic work is still incomplete)