Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Perl or python?

Name: Anonymous 2010-02-08 14:31


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? ; )

Name: Anonymous 2010-02-08 14:33

forced identation of code thread over

Name: Anonymous 2010-02-08 14:34

What do you mean by general purpose?

Name: Anonymous 2010-02-08 14:34

Use Lua, embed it in your C/C++ projects.

Name: Anonymous 2010-02-08 14:36

>>3
fibs/factorials

Name: Anonymous 2010-02-08 14:50

be a man, use perl.

Name: Anonymous 2010-02-08 15:05

Perl is better for writing short one-liners on the command line.

Name: Anonymous 2010-02-08 15:11

Perl is only good if you're a sysadmin.

Name: Anonymous 2010-02-08 15:18

I don't know, maybe CL or FIOC? Java's a bit verbose, but I wouldn't say it's hard to code in it if you have a good IDE, but it may be overkill for throwaway code.

Name: Anonymous 2010-02-08 15:50

>>6
Can you be more specific....
>>7
Right.

Name: Anonymous 2010-02-08 15:52

>>10
>>7
Right.
No, not really.

Name: Anonymous 2010-02-08 16:06

I would recommend Perl. On the off chance that you build some  application someday and need a scripting language you will not be as tempted, knowing Perl, to embed Perl into it as you might be tempted, knowing FIOC, to embed FIOC. (And even if you did do it, the Perl case is less worse.)

Embedded FIOC is currently the nastiest sin against /prog/ramity. If you're considering it, pick a Lisp or an ECMAscript or really anything at all else instead. Javascript is actually pretty rockin' if you keep it well away from XML (HTML) DOM trees.

Name: Anonymous 2010-02-08 16:47

>>1
and PHP just wont cut it any more
WHAT
you mean you actually used PHP before?

Name: Anonymous 2010-02-08 22:45

>>12
what's so bad about embedded fioc?

Name: i_4029384029323423423423a 2010-02-08 23:15

use python

Name: Anonymous 2010-02-08 23:38

Personally I would say definitely Python. I find it more scalable, and the resulting code is always more maintainable. I'd tend to agree with those who recommend against embedding though. Only use Python if you don't care about speed and memory usage.

Since you have experience in PHP though you might prefer Perl, since the syntax will probably be pretty familiar (disclaimer, I've never used PHP.)

>>12
Javascript is actually pretty rockin' if you keep it well away from XML (HTML) DOM trees.
How does one do this? I have some experience with ECMAscript in web pages but I'd love to learn it proper by writing a standalone app. And at first glance it seems like it would make an excellent language for embedding.

Name: Anonymous 2010-02-09 0:58

Perl: Thickens your neckbeard
Python: Increases your chances of dating Leah Culver

Choose wisely son.

Name: Anonymous 2010-02-09 2:01

>>17
Obviously Perl then

Name: Anonymous 2010-02-09 2:50

Python. Perl era is over, let's face it.

Name: Anonymous 2010-02-09 3:07

You could probably learn the entire Python language in the time it would take you to learn the first couple of pages of Perl idioms and handy shorthands. Which leads me to say, if you're going to learn both, learn Python first. And never learn Perl unless you're already a good programmer.

Name: Anonymous 2010-02-09 4:10

>>20
    And never learn Perl unless you're already a good programmer.

the first language i learned was perl, its just as good as any other language if you leave out the crap thats unreadable.

Name: Anonymous 2010-02-09 4:41

>>21
Perl was my first language, too, but that was so long ago, I don't remember a thing.

Name: Anonymous 2010-02-09 6:45

perl is my mother tounge

Name: Anonymous 2010-02-09 6:51

This "Perl is write-only" bullshit is propagated mainly by those python faggots, whose language is too retarded to even let you write loop in one line. I've never seen any Perl code (besides golf and stuff like this) which I could call unreadable. Good Perl programmers write good code, period.

Name: Anonymous 2010-02-09 8:46

>>24

`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$«,$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$»),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$«.»$;$/$%[$?]$_$\$,$:$%[$?]",$«&$~,$#,);$,++
;$,++;$^|=$»;`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`

VALID PERL CODE, AFAIK.

Name: Anonymous 2010-02-09 9:03

>>25
Because writing a script as cryptic as possible proves the language is hard to understand.

Name: Anonymous 2010-02-09 9:09

>>24
Or anyone who knows more than perl and can see by inspection that perl is fucking write-only for anything over a few hundred lines.

Name: Anonymous 2010-02-09 9:32

>>25
[quote]>>25
(besides golf and stuff like this)
[/quote]

Name: Anonymous 2010-02-09 10:06

>>26
Because
U MENA IMPLYING?

Name: Anonymous 2010-02-09 10:34

>>24
Good programmers write good code, period.

fixed it for you

Name: Anonymous 2010-02-09 11:04

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.

Name: Anonymous 2010-02-09 11:10

>>6
#!/usr/bin/perl
use perl;


Can't locate perl.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./perl.pl line 2.
BEGIN failed--compilation aborted at ./perl.pl line 2.

Name: Anonymous 2010-02-09 11:32

>>6
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

Z:\>man perl
'man' is not recognized as an internal or external command,
operable program or batch file.

Name: Anonymous 2010-02-09 11:34

>>6

perl -e 'print `man perl`;'

Name: Anonymous 2010-02-09 13:20

perl -e 'print qx/perl -e "print qx(man perl)";/'

Name: tlsvg 2010-02-09 13:33

Depends on how fast you'd like to develop your ideas.

Both perl and python are fantastic.

Lot of times I've found myself in a situation like "lets code in language X" just for the heck of it - but that is mostly for personal projects. Python and perl were like that for me. Python was exciting (despite the FIOC) saving me lines of code.

Professionally I've been using PHP a lot for dynamic webpages, writing command line php tools as well, and I mostly like the similarity of the methods 'looking' like C language. (You can tell it held my interest ;) ) PECL helps sometimes as well, so does the footprint of embedding PHP (part of LAMP stack) in embedded programs.

I'd say select one a week, build an entire prototype in each of the language, see what you learned along the way -- who knows you might lean on one over the other, but unless you try you won't know!

Name: Anonymous 2010-02-09 13:43

Python is very deliberate, and is not dissimilar to structured English.
Perl, once you know what you're doing, enables you to get a lot of complex stuff done in as few or as many lines as you like.

Python is easier to learn, but not as in-depth.

Name: Anonymous 2010-02-09 14:13

Ruby

Name: Anonymous 2010-02-09 14:51

>>38
Ruby on rails is slow as fuck.

Name: Anonymous 2010-02-09 14:57

>>39
Programming in ruby after doing rails, however, can increase typing speed by up to 5000%, thus negating the meagre execution speed.

Name: Anonymous 2010-02-09 15:34

>>40
Only if you use TextMate.

Name: Anonymous 2010-02-09 17:39

Rails lets you do a full commercial application in 500 lines of code, but every line requires 10 minutes of researching unclear documentation, outdated blogs, and getting insulted on their IRC channel.

Name: Anonymous 2010-02-10 2:40

>>42
Correction: Lets you do a full SLOW AS FUCK slow commercial application.

Name: Anonymous 2010-02-10 3:05

>>42
That about sums up Japanese culture.

Name: !iN.MY.aRMs 2010-02-10 3:13

FORTRAN77 is the best

Name: Anonymous 2011-02-04 14:37

Don't change these.
Name: Email:
Entire Thread Thread List