5 ms·
This sort of thing is still needed. I have a friend who's boss wont let him use anything except c, php, and perl. Any attempts to get python in there are met wi
by sophacles 17y ago
This sort of thing is still needed. I have a friend who's boss wont let him use anything except c, php, and perl. Any attempts to get python in there are met with resistance and vague hysteria. More posts like these from can slowly lower people's loyalty to php, and contribute to saving my friend and many like him.
- deleted 17y ago[deleted]
- igorgue 17y agoWell, I'm actually in the same problem, but I inject Python every time I can, because is not the same saying: "Can I do this in Python?" than "I already did this in Python!"
- aristus 17y agoThat often works, but if you don't then teach others on the language and your code it will get ripped out the minute after you leave.
- jrockway 17y agoWell, is Perl really a problem? Anything you can do in Python you can do in Perl just as easily; Perl actually has more abstractions available for the programmer than Python. (Grammars in regexes, real closures, coroutines, a metaobject system, etc.) Also, last time I checked the programming language shootout, Perl 5.10 is slightly faster than Python 3. So with that in mind, the logical "step up" from Perl would be something like Haskell. Python is pretty much Perl with different syntax, less features, and the impression that it's "cleaner" because nobody ever bothered using it for "quick and dirty" scripting.
- rbanffy 17y ago"Anything you can do in Python you can do in Perl just as easily" I can't read my Perl code from six months ago like I can read my Python code ages ago. There are far too many ways to do the same thing in Perl, not every one of them obvious. And I disagree with my past self a lot.
- deleted 17y ago[deleted]
- kingkongrevenge 17y agoI'm always a bit puzzled by these claims of unreadable perl. Go find me perl I can't read: http://search.cpan.org/ http://search.cpan.org/ . Where is it?
- plinkplonk 17y ago"I'm always a bit puzzled by these claims of unreadable perl." unreadable for the claimants not for you. "Go find me perl I can't read .. Where is it?" Any language, no matter how obscure, will have some practitioners who can read any code written in it. I am sure someone can say this about APL "What do you mean APL is unreadable? I can read any APL code fragment". To repeat, they are saying they can't read it not that you can't. Don't take it personally. Use what works for you.
- staunch 17y agoIt's a totally bogus claim. The only people that can't read their own Perl after 6 months are the people that don't really know Perl. And by "know" I just mean they read and understood most of Programming Perl/Objected Oriented Perl. Anyone who has studied those two books can understand 99%+ of the code on the CPAN. A lot of people have made a few halfhearted attempts at using Perl and were so put off by the scary looking sigils that they gave up. Then they blame Perl to comfort themselves. It's not them that's too lazy to look past a new kind of syntax, it's the language's fault!
- plinkplonk 17y ago"The only people that can't read their own Perl after 6 months are the people that don't really know Perl." again replace "perl" with "APL" or "BrainFuck" (or any language with baroque syntax) and the above sentence is as (in)valid. This comes close to the "No True Scotsman" fallacy. If you really knew perl you would have no problems with reading it. Sure, but that applies to anything, no matter how convoluted. It doesn't matter whether you think their claims are "bogus" or not, or whether they meet your standards of "really" knowing perl. Some people find that they can read their own code in other languages easier than their own code in perl after 6 months. You might think this "bogus", that doesn't matter. For them, that is a reality they have to deal with. And many deal with it by shifting to other languages and leaving perl to its aficionados. This is as it should be. Everyone should use the language they like and not use languages they dislike (irrespective of my or your stances on what they should like or whether their claimed reasons for dislike is "bogus"). Nobody is compelling you to abandon perl. So what's your problem with them not using perl? A language is a UI for programmers. Some people find some UIs hard. Telling them that their discomfort is "bogus" is not very useful. I use a lot of Haskell. Many people say they find its type system, monads etc "too hard". That isn't a "bogus claim". And "If they really knew Haskell they wouldn't find it hard" (where I define the "really knew") is a useless statement. I use Haskell, they don't. Everyone is happy. Live and let live. There are enough languages for all of us.
- sophacles 17y agoPerl itself is not the problem. According to my friend, the problem comes from available tools: the ones he needs already exist for python but not for perl. As for quick and dirty scripting in python: I do it all the time. Hell I just made a little "framework" [1] in python to do this better. I missed the while <> construct from perl for doing filters, so I made it easier to do in python. The funny thing is, many of my quick and dirty python scripts end up looking like more thought was put into them, and being more flexible, than they were ever intended to be. [1] http://pypi.python.org/pypi?name=pyCLiFF&version=0.1&:action=display http://pypi.python.org/pypi?name=pyCLiFF&version=0.1&...
- kingkongrevenge 17y ago> the ones he needs already exist for python but not for perl Rather unlikely.
- gaius 17y agoNo really, hence the saying "only Perl can parse Perl". Despite its dynamic typing, Python is quite amenable to tool support because of its regularity.
- zaphar 17y agoThats funny. I could say the same thing about the perl scripts I write. For that matter I could say the same thing The point is language and syntax for some of us at least has little bearing on how clear the code is. And like jrockway said perl is expressive enough that you can do far more abstraction in it. The only languages I've seen so far that can beat perl for expressive power are lisp and haskell.
- jamongkad 17y agoAs long as Python continues to not utilize multi-line lambdas. Then Perl and Ruby will continue to be a usable Lisp. But I don't think that's a bad thing. Python is Python and that's that.
- tptacek 17y ago"Perl with different syntax" is a prolix way of saying "better". ;)
- codexon 17y agoPython 3 smokes Perl. http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=python3&lang2=perl&box=1 http://shootout.alioth.debian.org/u32q/benchmark.php?test=al... And most people are using 2.x which is even faster. http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=python&lang2=perl&box=1 http://shootout.alioth.debian.org/u32q/benchmark.php?test=al...
- kingkongrevenge 17y agoThat's winning at the special olympics. They are both so slow you'd never use either for cpu constrained tasks.
- sandGorgon 17y agoThat is plain offensive. The special olympics are an even greater achievement of the human body as a machine, since it must push itself with far lesser degrees of freedom.
- deleted 17y ago[deleted]
- pieceofpeace 17y agoAs I saw, it was not meant to be offensive. Special olympics are for special people. They are not the best among all competitors. Most interpreted languages are not comparable to compiled languages.
- jrockway 17y agoNeither Perl nor Python are interpreted. They are both just slow.
- gaius 17y agoWhy not? NumPy offloads all the heavy lifting to LAPACK and BLAS which is some of the most optimized code on the planet. Numeric work in Python is bread-and-butter for many people.
- nostrademons 17y agoSometimes taking out features is more important than having them. Python fans usually like it because every feature is exceptionally well-thought-out, not because there are a lot of features.
- jrockway 17y agoI have never heard anyone refer to Python's lambdas as "exceptionally well-thought-out" before. Python, like any programming language, is not perfect. There's simply less to not be perfect.
- jamongkad 17y agoAgreed not everything in Python is well thought out. Lambdas and .join comes to mind.