Python or Perl?

Questions about programming languages and debugging
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Python or Perl?

Post by ayu »

I can't decide which one I want to use ....

I need a new scripting language that I can use for general purpose coding, C/C++ is for my bigger projects, and PHP just wont cut it any more. And let's not speak about Java, it's a horrible language (just don't like it, no reason needed)

I think the best thing to do is to buy 2 books, one on Perl and one on Python, and try them both.

Anyone have any thoughts about any of them that would help me in my decision? ; )
"The best place to hide a tree, is in a forest"

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

PHP won't cut it? O_o oh well.

I would say python, that way you have our very own python guru - maboroshi - to help you with any questions ^_^

Although, i think b_b knows perl... so he may be able to help you with that.
¯\_(ツ)_/¯ It works on my machine...

User avatar
maboroshi
Dr. Mab
Dr. Mab
Posts: 1624
Joined: 28 Aug 2005, 16:00
18

I have no

Post by maboroshi »

I have no comment both are good languages to learn

I just stuck with python perhaps cause I am crazy :-P

Most people will argue a lot about this topic.

User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Post by leetnigga »

Both are excellent choices.

I stuck with Python because it looks cleaner and I've grown quite fond of things such as Sage and Werkzeug.

Work with both of them a little and see which you prefer. There's no bad choice in my opinion.

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Post by lilrofl »

A little joke that I read when trying to decide which language to learn. After reading this I asked around and found unanimously python accepted as the better choice... but it's also the only one that I've become functional with, so I may be a bit narrow minded :D


EXTERIOR: DAGOBAH--DAY
With Yoda strapped to his back, Luke climbs up one of the
many thick vines that grow in the swamp until he reaches the
Dagobah statistics lab. Panting heavily, he continues his
exercises--grepping, installing new packages, logging in as
root, and writing replacements for two-year-old shell scripts
in Python.

YODA: Code! Yes. A programmer's strength flows from code maintainability. But beware of Perl. Terse syntax... more than one way to do it... default variables. The dark side of code maintainability are they. Easily they flow, quick to join you when code you write. If once you start down the dark path, forever will it dominate your destiny, consume you it will.

LUKE: Is Perl better than Python?

YODA: No... no... no. Quicker, easier, more seductive.

LUKE: But how will I know why Python is better than Perl?

YODA: You will know. When your code you try to read six months from now.
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

@lilrofl
hahaha ... XD
"The best place to hide a tree, is in a forest"

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11636
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

well, personally I would say "go for Perl!!"....but I have to admit it's more because of a romantic old-school Unix sympathy and not because of logic... :lol:
actually Python the "better" language because it forces you to write clean code....the only disadvantage compared to Perl is the lack of documentation (maybe not really for the Python core itself, but at least for APIs that enable Python to work together with other platforms like Apache for example).
Image

pseudo_opcode
cyber messiah
cyber messiah
Posts: 1201
Joined: 30 Apr 2006, 16:00
17
Location: 127.0.0.1

Post by pseudo_opcode »

Perl has a very steep learning curve... and like stated before, "More than one ways to do every thing"

On the other hand i dont know shit about python, but since we have Dr.Mab, and he does amazing things with it.. i'd say go for it,

pseudo_opcode
cyber messiah
cyber messiah
Posts: 1201
Joined: 30 Apr 2006, 16:00
17
Location: 127.0.0.1

Post by pseudo_opcode »

btw i am really curious as to why php wont cut it?
And it wont cut what?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

pseudo_opcode wrote:btw i am really curious as to why php wont cut it?
And it wont cut what?

Because it's more meant for dynamic sites. And it's too nice, allows sloppy code. I simply want something new to chew on, a scripting language that I can use as my "standard" scripting language when I just need to write some random script, and imo php feels too small for that purpose sometimes.

And it wont cut my bread in the mornings.
"The best place to hide a tree, is in a forest"

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Post by lilrofl »

cats wrote:And it wont cut my bread in the mornings.
Python cuts my bread in the morning... and fries and egg on it...
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

pseudo_opcode
cyber messiah
cyber messiah
Posts: 1201
Joined: 30 Apr 2006, 16:00
17
Location: 127.0.0.1

Post by pseudo_opcode »

cats wrote:
pseudo_opcode wrote:btw i am really curious as to why php wont cut it?
And it wont cut what?

Because it's more meant for dynamic sites. And it's too nice, allows sloppy code. I simply want something new to chew on, a scripting language that I can use as my "standard" scripting language when I just need to write some random script, and imo php feels too small for that purpose sometimes.

And it wont cut my bread in the mornings.
I have written system applications and monitoring scripts in php, they are in action as we speak, I wrote a complete security monitoring suite for 30+ servers in php, all run via command line.

Why? i found the specific functions and libraries required were better supported in php than they were in perl.

About sloppy coding, every language allows it, if one didnt then Information Security would only have been a hypothesis.

But many people say perl is system admin's best friend, where bash limits you, perl will expand your possibilities.

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

lilrofl wrote: Python cuts my bread in the morning... and fries and egg on it...
That's awfully convenient =o
"The best place to hide a tree, is in a forest"

User avatar
lilrofl
Siliconoclast
Siliconoclast
Posts: 1363
Joined: 28 Jan 2009, 17:00
15
Location: California, USA
Contact:

Post by lilrofl »

cats wrote:
lilrofl wrote: Python cuts my bread in the morning... and fries and egg on it...
That's awfully convenient =o

Yeah, it's good about that... however it forgets to add milk to the eggs which makes them come out flat :/
knuffeltjes voor mijn knuffel
[img]http://i911.photobucket.com/albums/ac320/stuphsack/Sig.jpg[/img]

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

lilrofl wrote:
cats wrote: Yeah, it's good about that... however it forgets to add milk to the eggs which makes them come out flat :/

ah, shame : /
"The best place to hide a tree, is in a forest"

Post Reply