Python or Perl?

The place for chatting and discussing subjects unrelated to Wesnoth.

Moderator: Forum Moderators

Python or Perl?

Python
19
73%
Perl
7
27%
 
Total votes: 26

monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Python or Perl?

Post by monochromatic »

Mods: it'd be awesome if this was a poll. Well, I guess it doesn't have to. Your call.

Hey,

As you all may know, I've been trying to learn lua since January thus year. Lua is a light and very small language, so I think I've grasped the basics and have begun to understand some of the more complex things in Lua. So I kind of want look at another language while I continue studying lua. C++, python, and perl come to mind. C++ is probably too hard for me now, so I think I'll do either python or perl. And so you know my coding background, it's not much. Other than, I've only learned markup languages.

So, which one do you think is more worth learning? Your opinions please.
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Python or Perl?

Post by Gambit »

Touchy topic is touchy. The choice is entirely personal opinion. Neither one truly has any advantages over the other. They just do things differently.
This community is awesome, so I normally don't need to say this, but please, let's keep this civil.
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Python or Perl?

Post by thespaceinvader »

I like pythons, because they hiss. Perls are boring because I don't like knitwear. But I fail to see the comparison.

*whisperwhisperwhisper*

What do you mean 'programming language'?!

;)
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Python or Perl?

Post by monochromatic »

Gambit wrote:Touchy topic is touchy. The choice is entirely personal opinion. Neither one truly has any advantages over the other. They just do things differently.
:augh: Then let's keep it at this question: what things are each one good at?
Gambit wrote:This community is awesome, so I normally don't need to say this, but please, let's keep this civil.
Yes please. :D
thespaceinvader wrote:I like pythons, because they hiss. Perls are boring because I don't like knitwear. But I fail to see the comparison.
Then what the heck is C? Seems awfully boring to me. Let's all go get rubies!
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Python or Perl?

Post by Gambit »

monochromatic wrote: :augh: Then let's keep it at this question: what things are each one good at?
They're both pretty much equally good at the same things (everything). They're both generally the same speed too.

It really comes down to which syntax you prefer.

perl:

Code: Select all

if (1) {
  print "Hello world";
}
else {
  print "NOT POSSIBLE!";
}
python:

Code: Select all

if 1 == 1:
    print "Hello world"
else:
    print "NOT POSSIBLE!"
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Python or Perl?

Post by monochromatic »

Gambit wrote:
monochromatic wrote: :augh: Then let's keep it at this question: what things are each one good at?
They're both pretty much equally good at the same things (everything). They're both generally the same speed too.

It really comes down to which syntax you prefer.

perl:

Code: Select all

if (1) {
  print "Hello world";
}
else {
  print "NOT POSSIBLE!";
}
python:

Code: Select all

if 1 == 1:
    print "Hello world"
else:
    print "NOT POSSIBLE!"
I see. From my inexperienced eye, python resembles lua alot in terms of syntax.

Code: Select all

if 1 == 1 then
    print("Hello world")
else
    print("NOT POSSIBLE!")
end
It can be condensed, but I'm just writing it like that to show the similarity.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Python or Perl?

Post by Crendgrim »

Python is a language that forces you to indent your code correctly. However, it's been a long time since I last used Python; and I never used Perl seriously, so I can't really give some advice.
Personally, I don't like Perl's syntax very much, but I know many people who love it.


Crend
UMC Story Images — Story images for your campaign!
User avatar
Elvish_Hunter
Posts: 1575
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Python or Perl?

Post by Elvish_Hunter »

monochromatic wrote:Let's all go get rubies!
Did you knew that there is a programming language called Ruby? In some aspects, its syntax is even more similar (IMO) to Lua than Python - it uses also the nil values... :P On the other hand, it seems to have less libraries available than Python and Perl.
Just to know, do you plan to make GUI programming in future? If yes, you may be interested in knowing that (for what I know) usually you can choose between four graphical libraries: Tk, Gtk, Qt and Wx. All of them are available for several languages: Python, Perl, Ruby, Lua, C++ and others. Just a note for the future. :)
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Joram
Posts: 366
Joined: September 2nd, 2008, 5:36 am

Re: Python or Perl?

Post by Joram »

Python is obviously the better language, on authority of Yoda
The Fires of Pride 0.3, a heavily story based campaign.
On hold while I try and finish my book
MCP
Posts: 518
Joined: May 23rd, 2005, 5:23 pm
Location: California

Re: Python or Perl?

Post by MCP »

Very funny link there Joram.

6 months and any code is tough already. :doh:
User avatar
ancestral
Inactive Developer
Posts: 1108
Joined: August 1st, 2006, 5:29 am
Location: Motion City

Re: Python or Perl?

Post by ancestral »

Perl syntax is short, sweet and poetic.
Wesnoth BestiaryPREVIEW IT HERE )
Unit tree and stat browser
CanvasPREVIEW IT HERE )
Exp. map viewer
uncleshelby
Posts: 427
Joined: May 10th, 2011, 7:20 pm

Re: Python or Perl?

Post by uncleshelby »

I love python. I used to do some Perl, but it got complicated, so I tried Python. And python has helped me out SO MUCH. I'm thinking about trying Perl again now...
Timshel
User avatar
Maiklas3000
Posts: 532
Joined: June 23rd, 2010, 10:43 am

Re: Python or Perl?

Post by Maiklas3000 »

Perl is a nasty, evil language, great for quickly whipping up data manipulation utilities. However, you won't learn good coding style, which is what you need if you're a relative novice.
User avatar
Gambit
Loose Screw
Posts: 3266
Joined: August 13th, 2008, 3:00 pm
Location: Dynamica
Contact:

Re: Python or Perl?

Post by Gambit »

I'm not sure if style == syntax, but in regards of the latter Perl is more similar to C++ and C than Python is. As far as nasty, and evil… eh.
User avatar
dipseydoodle
Posts: 879
Joined: September 16th, 2008, 10:26 pm

Re: Python or Perl?

Post by dipseydoodle »

The way I see it is this:

They're both scripting languages but, I see python as a more traditional language (like java, ruby etc...). Perl seems to me to be more simplistic and easier to understand.
Post Reply