Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
pikaporeon
Gerbil Jedi
Topic Author
Posts: 1573
Joined: Mon Nov 19, 2007 4:42 pm
Location: Ottawa, Ontario, Canada
Contact:

Perl or Python?

Sun Feb 24, 2008 11:06 am

So I've decided, three years after my last highschool computer science class, I really want to get into coding more seriously on my own. I decided a good foot in the door would be a scripting language like Perl or Python, and have a book on each of them lying around.
For past experience I have about a year and a half of school-taught Java knowledge, as well as a cursary knowledge of C, BASIC, and Visual Basic, as well as knowing how to write DOS batch files (which is.. hardly complex. lol)

I'm divided on what to learn how however. I mean, there's perl, where I can swing in on a rope, tell everyone to stand back as i know regular expressions, and work my *perl* magic er it has slightly more syntactic similarities with Java and C, as well as from what I've seen slightly more commonly implimented, coupled with the fact that I view programming very much as an artform as much as a craft and am a huge fan of the "there's more than one way to do it" philosophy"

On the otherhand Python will make me fly is very simple, well implemented, and just strikes me as an easy efficiant language. However I don't like its engineering "This is the right way" mindset

Ultimatly I'd like to learn both, but I'm a university student and passing that is my biggest priority, and I'd rather only be fighting with one language initially on the side.

Any thoughts?
Hey girl you want a bad boy? I overclock my backup servers.
Ryzen 9 5900X | 2070 Super | 32 GB RAM | BX100 500 GB+MX500 500GB+660P 1TB
Sempron [email protected] | 2 GB RAM | 6 TB | FreeBSD 12
 
bthylafh
Maximum Gerbil
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Perl or Python?

Sun Feb 24, 2008 11:26 am

Python would probably be easier to maintain if you came back to your code in a few years, simply because it's not as free-form as Perl.

It's pretty bad when you look at your own code and say "WTF? What am I doing here?" :D
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
Swampangel
Gerbil Team Leader
Posts: 287
Joined: Sun Aug 31, 2003 10:54 am
Location: Nova Scotia, Canada

Re: Perl or Python?

Sun Feb 24, 2008 11:26 am

Over the last year I have learned a fair bit of both languages. I'm still novice-level at best but I can get around in either one.

And my position is: I love Perl, but I would recommend Python. For the reasons you list, Python will allow you to produce working complex programs in less time. Like it or not, the engineering approach is a practical one, and Python will be a valuable tool, especially if you're in a university program where it is useful to write simple scripts to automate repetitive calculations or tasks.

Then, when you've had enough of writing colons after if statements, dive into Perl, and feel narrow, claustrophobic hallways give way to limitless horizons and endless blue sky. Finally, you've found the language that lets you write the most beautiful code in the universe that only you can decipher. :wink:
 
pikaporeon
Gerbil Jedi
Topic Author
Posts: 1573
Joined: Mon Nov 19, 2007 4:42 pm
Location: Ottawa, Ontario, Canada
Contact:

Re: Perl or Python?

Sun Feb 24, 2008 1:27 pm

I daresay my Poli-sci program won't need much repetitive scripts except when i spend more time playing with linux than actually paying attention in class.

I think I'll dodge the perl-WTFAMIDOING phobia as I'm such a compulsive commenter. I was tought to comment every line [which I don't do. I think we can figure out what int x = 1 means) but I always make sure my code is well documented because I'm so bad at looking at code and just "getting it" right away.
Hey girl you want a bad boy? I overclock my backup servers.
Ryzen 9 5900X | 2070 Super | 32 GB RAM | BX100 500 GB+MX500 500GB+660P 1TB
Sempron [email protected] | 2 GB RAM | 6 TB | FreeBSD 12
 
mortifiedPenguin
Gerbil Elite
Posts: 812
Joined: Mon Oct 08, 2007 7:46 pm

Re: Perl or Python?

Sun Feb 24, 2008 1:44 pm

pikaporeon wrote:
I was tought to comment every line [which I don't do. I think we can figure out what int x = 1 means) but I always make sure my code is well documented because I'm so bad at looking at code and just "getting it" right away.


While commenting every single line is helpful in some instances, I find that it sometimes gets in the way of rereadablity (as ironic as it sounds) because it breaks the flow of your code (things aren't right next to each other anymore). it is far more important (if you ask my instructors anyway, and i tend to agree) to have code that is self documenting / self explanatory (i.e. using "int counter" instead of "int x"). As for your question about perl vs python... I don't know either, so I never really understood the idea of "beautiful code" that perl programmers seem to go off on tangents about (I am a Java and C++ programmer if you're wondering).
2600K @ 4.8GHz; XSPC Rasa/RX240/RX120 Phobya Xtreme 200; Asus P8Z68-V Pro; 16GB Corsair Vengeance 1333 C9; 2x7970 OC w/ Razor 7970; Force GT 120GB; 3x F3 1TB; Corsair HX750; X-Fi Titanium; Corsair Obsidian 650D; Dell 2408WFP Rev. A01; 2x Dell U2412m
 
pikaporeon
Gerbil Jedi
Topic Author
Posts: 1573
Joined: Mon Nov 19, 2007 4:42 pm
Location: Ottawa, Ontario, Canada
Contact:

Re: Perl or Python?

Sun Feb 24, 2008 2:24 pm

semantics and art. Sometimes being limited to only one way of doing things especially if you're used to another way from a different language might be frustrating.
Hey girl you want a bad boy? I overclock my backup servers.
Ryzen 9 5900X | 2070 Super | 32 GB RAM | BX100 500 GB+MX500 500GB+660P 1TB
Sempron [email protected] | 2 GB RAM | 6 TB | FreeBSD 12
 
just brew it!
Administrator
Posts: 54500
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Perl or Python?

Sun Feb 24, 2008 3:02 pm

My personal vote would be for Python. It is structured enough to encourage you to adopt a logical approach to the problem and write readable code, but it doesn't get in the way. It also works quite well for agile development and rapid prototyping.

Unless you're planning on working with obscure platforms and/or embedded development, I don't think Python is any less widely available than Perl. It is certainly well-supported on all of the major desktop/server platforms (Windows, Linux/UNIX, OS X).
Nostalgia isn't what it used to be.
 
bthylafh
Maximum Gerbil
Posts: 4320
Joined: Mon Dec 29, 2003 11:55 pm
Location: Southwest Missouri, USA

Re: Perl or Python?

Sun Feb 24, 2008 4:06 pm

pikaporeon wrote:
semantics and art. Sometimes being limited to only one way of doing things especially if you're used to another way from a different language might be frustrating.


You can definitely write Fortran in Perl, yes. :wink:
Hakkaa päälle!
i7-8700K|Asus Z-370 Pro|32GB DDR4|Asus Radeon RX-580|Samsung 960 EVO 1TB|1988 Model M||Logitech MX 518 & F310|Samsung C24FG70|Dell 2209WA|ATH-M50x
 
bitvector
Grand Gerbil Poohbah
Posts: 3293
Joined: Wed Jun 22, 2005 4:39 pm
Location: San Francisco, CA

Re: Perl or Python?

Sun Feb 24, 2008 4:36 pm

Another vote for Python (I'm sure people who read Developer's Den won't be surprised). If we're comparing Perl to art, most Perl scripts would remind me of Jackson Pollack's works.

The tangent about commenting every line of code reminded me of Steve Yegge's latest blog post, "Portrait of a noob." I don't necessarily agree with all of the later content of his post (about dynamic versus static typing), but I definitely recognize the "over-commenting trivial things" when you are a beginner anti-pattern he starts off discussing.
 
Buub
Maximum Gerbil
Posts: 4969
Joined: Sat Nov 09, 2002 11:59 pm
Location: Seattle, WA
Contact:

Re: Perl or Python?

Sun Feb 24, 2008 5:51 pm

Python is a wonderfully elegant scripting language.

I would recommend perl only for maintaining code already written in perl, or for doing some very simple single-line script parsing.

Who is online

Users browsing this forum: No registered users and 12 guests
GZIP: On