Sign out
Bimmerpost
Login
BMW E39 5-Series Forum | 5Post.com
BMW Garage BMW Meets Register Search Today's Posts Mark Forums Read  
Go Back   BMW E39 5-Series Forum | 5Post.com > BIMMERPOST Universal Forums > Off-Topic Discussions Board > Video + PC Gaming / Computing

View Poll Results: Which do you prefer: Perl or Python?
Perl 0 0%
Python 3 60.00%
They're similar, just a matter of preference 2 40.00%
Voters: 5. You may not vote on this poll

Post Reply
 
Thread Tools Search this Thread
      12-21-2007, 09:43 AM   #1
Ninjaneer
Shadow Warrior
Ninjaneer's Avatar
United_States
91
Rep
2,094
Posts

 
Drives: '07 335i Sedan
Join Date: Aug 2006
Location: Florida

iTrader: (0)

Question Perl vs Python?

Curious to hear from some experienced programmers. I haven't dabbled in either Perl or Python but from what I know they can be handy for scripting quick tasks with efficient speeds and results, as well as using a lower number of lines of code to achieve a task compared to other popular languages such as C++, C# etc. (for example regex parsing). I believe MS uses Perl mostly while Google uses Python. Although I've heard there is that IronPython .NET extension of Python.

So any major differences between the two? Is there such a thing as one being better than the other, does it depend on the task at hand, or is it just a matter of personal preference? Which one would you suggest to someone if they were interested in learning?

Picking up on one of these is on my to-do-some-day list
__________________
335i E90 / Arctic / Gray / Burl Walnut / Steptronic / ZPP / ZSP / Paddles / CA / Nav / PDC / OEM Spoiler
Mods:
PIAA Angel Eyes, Rear Fog Switch, Escort X50 Blue hardwire, 30% Charcoal Llumar
Installing soon: Rear Power Outlets (Happy Robot mod!)
Appreciate 0
      12-21-2007, 10:37 AM   #2
Hawkeye
Brigadier General
Hawkeye's Avatar
No_Country
1152
Rep
4,283
Posts

 
Drives: '07 Z4 si Coupe, '08 R6
Join Date: Aug 2007
Location: Iowa

iTrader: (0)

Garage List
Depends on the task at hand. Personally I think of Python as more of a replacement/addition to Java than anything else. I have dabbled in it and I was not too impressed.

I would personally learn Perl first as I think anything you want to do with Python can be easily done with various other languages as well. That and I have only heard speak of Perl... Both are better than VBA though!
__________________
2007 Z4 3.0si Coupe 6 MT Black Saphire Metallic PP SP Heated M Seats Clutch Stop Stubby
2008 R6 Raven Black GPR Steering Stabilizer Comp Werks FE Hotbodies Flush Mount Blinkers
2016 GMC Sierra SLT Z71 Premium Plus 4x4 K&N CAI Toyo G2 LT305/55R20
Appreciate 0
      12-21-2007, 07:25 PM   #3
djmatty
Second Lieutenant
djmatty's Avatar
United_States
13
Rep
282
Posts

 
Drives: 2003 330i; 1999 328i (RIP)
Join Date: Feb 2007
Location: somewhere south

iTrader: (0)

Neither.
__________________
Appreciate 0
      03-16-2008, 10:25 PM   #4
twinturbodude
Member
twinturbodude's Avatar
United_States
2
Rep
47
Posts

 
Drives: 335xi
Join Date: Jun 2007
Location: MA

iTrader: (0)

Whoa, I'm replying to this thread about 4 months late, but what the heck...maybe the OP will come back and read it at some point. : ) I've done development in Perl off and on for about 12 years now, and like 6-7 for Python. Both are high level dynamically typed languages that excel at letting you get things done quickly, by trading off some amount of runtime speed. Like anything, when it comes to picking the right tool for the job it's all about what's most important and what the tradeoffs are. I've done a fair amount of C/C++ and some Java as well, and in my mind these are lower level systems/application languages that don't have a lot in common with the scripting languages like Perl, Python, Ruby, TCL, PHP, etc (so I disagree with the Python being a Java replacement idea mentioned above). Anyway, here's one person's view of the pluses and minuses of the two languages:

Perl
----
+ Highly optimized for speed of development. You can do a lot in a small amount of code.
+ Powerful...lots of different ways to do things. The motto of Perl is "TMTOWTDI"--There's More Than One Way to Do It.
+ Really great for text manipulation. Regex matching, etc can be done really trivially and the regex backend code in Perl is insanely optimized and fast.

- So optimized for speed of development you can write code you won't recognize or understand in 3 months. : ) This is in fact the main criticism of Perl...it's been called a "write-only" language due to the difficulties in understanding already written code.
- Because it's so powerful, there are many different ways of doing things, which contributes to the readability problem. People tend to learn subsets of Perl, and when you try to read someone else's code they may do things you've never even seen before.
- Certain constructs and things in the language seem "kludgy". Particular object oriented stuff--feels sorta like a hack. There's a lot of black magic under the covers of some things, and certain things just seem counterintuitive or just plain weird.

Python
-------
+ Also optimized for speed of development...like Perl, it's a dynamic scripting language so you can do loads with small amounts of code. Not quite so optimized as Perl, but this helps to make things more consistent and simple when it comes to syntax.
+ Elegant. More than anything else, this stands out to me...Python code is about the closest thing to executable pseudocode I've ever seen. The object oriented stuff is great...very simple and elegant. Namespaces and creating modules, a bit of a pain in the neck in Perl, just seem so simple it's ridiculous.
+ Readable. Unlike Perl, Python code is very readable. Because the philosophy is different ("There should be one--and preferably only one--obvious way to do it." vs. Perl's TMTOWTDI), Python is simpler to learn and more consistent. Often while trying to do something the first time your first guess will actually be how it really does work, very unlike Perl. : )

- Whitespace is significant. This bothers some people. Hell, I thought it was stupid when I first heard about it, but after trying it I actually like it now. : )
- Very slightly more verbose than Perl--this is part of the tradeoff of being more readable and understandable. The effect is almost negligible though, compared to how much less code it takes to write something in either compared to Java, C++, C#, etc.

So I end up writing quickie 50 line script to do crazy parsing in Perl, and anything that's going to grow and be part of a sizable body of code in Python. Especially if I want to do OO stuff, it gets done in Python. Both languages are cool and both have their quirks, but I find coding in Python the most fun and productive. YMMV. : )
__________________
e90 335xi / 6MT / titanium silver / black leather / premium / cold weather / sport / iPod
Appreciate 0
      03-24-2008, 07:12 AM   #5
Ninjaneer
Shadow Warrior
Ninjaneer's Avatar
United_States
91
Rep
2,094
Posts

 
Drives: '07 335i Sedan
Join Date: Aug 2006
Location: Florida

iTrader: (0)

Quote:
Originally Posted by twinturbodude View Post
Whoa, I'm replying to this thread about 4 months late, but what the heck...maybe the OP will come back and read it at some point. : )
Yep, I'm still around Thanks for taking the time to respond, that definitely helps. I've been leaning towards Python and this will probably push me in that direction further, but I'll keep your last statement in mind about quick scripts (Perl) vs. maintainable long-term projects (Python).

__________________
335i E90 / Arctic / Gray / Burl Walnut / Steptronic / ZPP / ZSP / Paddles / CA / Nav / PDC / OEM Spoiler
Mods:
PIAA Angel Eyes, Rear Fog Switch, Escort X50 Blue hardwire, 30% Charcoal Llumar
Installing soon: Rear Power Outlets (Happy Robot mod!)
Appreciate 0
      04-01-2008, 02:27 AM   #6
radix
you know he kills little girls like you
radix's Avatar
No_Country
240
Rep
897
Posts

 
Drives: -
Join Date: Feb 2008
Location: -

iTrader: (0)

Quote:
Originally Posted by Ninjaneer View Post
Curious to hear from some experienced programmers. I haven't dabbled in either Perl or Python but from what I know they can be handy for scripting quick tasks with efficient speeds and results, as well as using a lower number of lines of code to achieve a task compared to other popular languages such as C++, C# etc. (for example regex parsing). I believe MS uses Perl mostly while Google uses Python. Although I've heard there is that IronPython .NET extension of Python.

So any major differences between the two? Is there such a thing as one being better than the other, does it depend on the task at hand, or is it just a matter of personal preference? Which one would you suggest to someone if they were interested in learning?

Picking up on one of these is on my to-do-some-day list
ruby
Appreciate 0
Post Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 09:17 AM.




5post
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
1Addicts.com, BIMMERPOST.com, E90Post.com, F30Post.com, M3Post.com, ZPost.com, 5Post.com, 6Post.com, 7Post.com, XBimmers.com logo and trademark are properties of BIMMERPOST