5 ms·
So when I went to Google I learned Python. I enjoyed the language and used it a lot, it has a solid support base and pretty much anything you wanted to do you c
by ChuckMcM 13y ago
So when I went to Google I learned Python. I enjoyed the language and used it a lot, it has a solid support base and pretty much anything you wanted to do you could import a module to do it. When I went to Blekko they were a perl shop, which was a bit intimidating at first, but after programming in it for nearly 4 years now I find I can get from concept to first test faster in Perl than I could in Python. And I hadn't realized how much the Python indentation stuff bugged me until I got back into a scripting language with braces.
At the end of the day I find I prefer perl for quick things, and Python for multithreaded things.
- d23 13y agoCould 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)
- frou_dh 13y agoSorry for being petty, but what's this creeping pattern of folk leading with "So"? It reads poorly and sounds even worse.
- digisth 13y agoHere's more information on the linguistic development of starting sentences with 'So': http://chronicle.com/blogs/linguafranca/2011/12/02/so-it-turns-out-that-everyones-starting-sentences-with-so/ http://chronicle.com/blogs/linguafranca/2011/12/02/so-it-tur...
- frou_dh 13y agoGood links. Thanks. (Predictably the Chronicle article has a bunch of comedy geniuses using it as a comment!)
- ChuckMcM 13y agoIt is a reasonable question. I tend to write like I talk, which the Chicago manual of style frowns upon. It isn't a particularly 'creeping' pattern, it is quite common amongst people with whom I have regular informal conversations. That said[1], I probably feel the same way about the use of 'because' in informal speech. Which was recently upgraded to include the form "because <noun>." I don't find that a particularly compelling upgrade. [1] Another habitual favorite of mine.
- frou_dh 13y agoThere was a recent album release called "Because the internet". Absolutely horrific :-) --- I think what gets me about leading with "So" (more so in spoken converstaion) is that it makes the speaker sound like they're constantly, and consciously, having to reframe things in a form that the poor dummy they're speaking to will understand. Politicians do it a lot when answering questions. I also recognise that it's more innocently used when telling a story.
- ChuckMcM 13y ago
- adharmad 13y agoCan you please expand a bit on "Python for multithreaded things"? My understanding was that Python interpreter has a GIL, which limits the concurrency and performance.
- delluminatus 13y agoPython has a standard library called multiprocessing [1] that uses multiple processes (surprise!) to get around the GIL. [1]: http://docs.python.org/2/library/multiprocessing.html http://docs.python.org/2/library/multiprocessing.html
- Mithaldu 13y ago> My understanding was that Python interpreter has a GIL, which limits the concurrency and performance. Python is in that respect essentially the same as Perl with Coro built-in. ( https://metacpan.org/pod/Coro https://metacpan.org/pod/Coro )
- per06a2 13y agoI can't stand perl's philosophy: http://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it http://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_... Contrast with Python's philosophy: https://wiki.python.org/moin/TOOWTDI https://wiki.python.org/moin/TOOWTDI Python's philosophy may be limiting for some people, but I'd rather have code that I have a decent chance of reading and understanding the run-time behavior of than a language that encourages extreme personalization. The whole parsing thing doesn't help either: http://www.jeffreykegler.com/Home/perl-and-undecidability http://www.jeffreykegler.com/Home/perl-and-undecidability
- Mithaldu 13y agoI'd rather have a language where i can look at the code and decide with a glance whether it's batshit insane or not, than a language where the best code possible looks just like the most horrible and insecure garbage. :)
- kamaal 13y agoSo you can't stand any and all programming languages? Because you can do anything in more than one way in all languages. And that's the whole point in 'programmability'. And secondly its extremely rare that you will run into some obscure feature which indulges in the whole parsing thing you mentioned.