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? ; )
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.
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:
Anonymous2010-02-08 16:47
>>1 and PHP just wont cut it any more
WHAT
you mean you actually used PHP before?
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:
Anonymous2010-02-09 0:58
Perl: Thickens your neckbeard
Python: Increases your chances of dating Leah Culver
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:
Anonymous2010-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:
Anonymous2010-02-09 4:41
>>21
Perl was my first language, too, but that was so long ago, I don't remember a thing.
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.
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.
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:
Anonymous2010-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.
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:
Anonymous2010-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.