LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-27-2007, 05:42 PM   #1
dave201
LQ Newbie
 
Registered: Oct 2005
Location: Camelot
Distribution: cent, RH core, slax, slackware... *buntu...
Posts: 28

Rep: Reputation: 15
My needs: Perl vs. Python


I've been reading up on this entire argument, and most of it seems like a bunch of fluff. I don't care about whitespace or cryptic code, or a lot of the other stuff people flame on about between the two. I can work just fine in ksh/bash. Bash feels the most comfortable, and I've written entire programs (5000+ lines) in Bash that people use on a day to day basis. I've also written a lot of "mission critical" applications in korn that my company relies and makes money on. I make heavy use of awk and sed, and standard UNIX utilities like wc, touch, grep and so on. Bash just works for me because I know it, and its there with every system I work on.

I have some desires that need fulfilling (i sound like my gf). I'll be finishing school come October, and would like to dedicate what free-time I have to learning a new language.

* a language that can produce and handle nice *attractive* GUIs
* something fast or minimalistic
* something that I can contribute to the Linux community with (very important as I'd like to leave it open as a second form of income or full time work in the near future)
* a language that can work on a variety of platforms... not just i386 PCs; cellphones? (i'm thinking OpenMoko)
* something (and I know this may sound bad) that I can make a decent living off of.

So? Anyone? I'm not looking for a replacement for Bash or Korn. I'm looking for something that could possibly work WITH these shells, but go deeper into the heart of the computer... something deeper than bash.

Something is telling me "PYTHON, dude!", but something else is saying, "Perl, Sir"...

Last edited by dave201; 07-27-2007 at 05:44 PM.
 
Old 07-27-2007, 05:53 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Disclosure: I am not a programmer.

You might want to learn an interpreted language like Python, but I would think you would want to know C regardless. I have been studying Python and one thing that got my attention was the statement that a typical application might be built in Python, but with specific modules in C (where the speed difference was significant).
 
Old 07-27-2007, 06:01 PM   #3
dave201
LQ Newbie
 
Registered: Oct 2005
Location: Camelot
Distribution: cent, RH core, slax, slackware... *buntu...
Posts: 28

Original Poster
Rep: Reputation: 15
I've got some c++ experience, up to "sets and gets" actually. I learned it freshman year in college while I was studying Mechanical Engineering...but never really did anything with it.
 
Old 07-27-2007, 06:07 PM   #4
binutils
Member
 
Registered: Feb 2007
Posts: 59

Rep: Reputation: 15
Perl,

or c in gtk.(it was pleasant experience).

http://o-hand.com/
 
Old 07-27-2007, 10:05 PM   #5
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
Perl & Python are not fast.
Java is not minimalistic.
The only language I know that suits your expectations is C.
As far as your contribution to the F/OSS community goes, how about helping GDB with their time-traveling debugger?
 
Old 07-28-2007, 01:38 AM   #6
paddy3118
LQ Newbie
 
Registered: Jul 2007
Location: Bristol UK
Distribution: RedHat, Cygwin
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by dave201
I've been reading up on this entire argument, and most of it seems like a bunch of fluff. I don't care about whitespace or cryptic code, or a lot of the other stuff people flame on about between the two. I can work just fine in ksh/bash. Bash feels the most comfortable, and I've written entire programs (5000+ lines) in Bash that people use on a day to day basis. I've also written a lot of "mission critical" applications in korn that my company relies and makes money on. I make heavy use of awk and sed, and standard UNIX utilities like wc, touch, grep and so on. Bash just works for me because I know it, and its there with every system I work on.

I have some desires that need fulfilling (i sound like my gf). I'll be finishing school come October, and would like to dedicate what free-time I have to learning a new language.

* a language that can produce and handle nice *attractive* GUIs
* something fast or minimalistic
* something that I can contribute to the Linux community with (very important as I'd like to leave it open as a second form of income or full time work in the near future)
* a language that can work on a variety of platforms... not just i386 PCs; cellphones? (i'm thinking OpenMoko)
* something (and I know this may sound bad) that I can make a decent living off of.

So? Anyone? I'm not looking for a replacement for Bash or Korn. I'm looking for something that could possibly work WITH these shells, but go deeper into the heart of the computer... something deeper than bash.

Something is telling me "PYTHON, dude!", but something else is saying, "Perl, Sir"...
I would advocate Python.
5000+ lines of bash is a lot of bash scripting! Python would help in organising large programs for easier development and maintenance with features such as functions, modules, and classes that allow you to break that big idea into manageable interacting chunks that might even be developed and tested separately before integration and testing as a whole. New data-types and data-structures such as long-integers, decimals, sets and lists help in making the solution fit your pseudo-code design brief.
Python is not a bash replacement as it does not do the one-liner. But it is complementary to bash.

To go through your bullet list:
* Their are Python ports for a large number of GUI frameworks/libraries try googling for Python plus the name of a Linux GUI framework for an idea.
* You know how scripting languages are supposed to work, a bit of their own code gluing together other utilities; well Python does that with a twist: Python comes with its own extensive library - pre-installed, and is also used to wrap loads of other libraries written in other languages such as C, C++, and Fortran. If you look up IPython and Scipy or Biopython you will find Python based tools that scientists and engineers are using to do computationally intensive work with. Python is fast to develop, fast to test, and is usually fast enough - as you probably know 'cos when I was writing large awk programs I had my doubters that said I should use C for speed, until they saw the results developed in a very short time and being fast enough to not impact the overall time to completion of a task (whats three minutes when the output is going to take 6 hours of processing in the tool it is feeding).
* You want to contribute! Python is used all over the Linux world. Notables might be Ubuntu, OLPC, MAEMO, and openmoko.
* Python is being used on some of the smaller platforms such as OLPC and mobile phones. Its on a large range of desktop & server OS's too.
* Some do make a living off Python programming. A lot more, like myself, use Python to enable themselves to complete their main tasks - mine being to create and maintain design flows for our ASIC Design engineers to create microchips used in from mobiles to F1 racing car engine management systems (but I never get invited to a race )

Your instincts are right, Choose Python!

- Paddy.
 
Old 07-29-2007, 12:05 AM   #7
dave201
LQ Newbie
 
Registered: Oct 2005
Location: Camelot
Distribution: cent, RH core, slax, slackware... *buntu...
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by paddy3118
I would advocate Python.
5000+ lines of bash is a lot of bash scripting! It runs smooth too

Your instincts are right, Choose Python!
Ahh, thank you! Thats what I needed. Its been in the back of mind for quite some time now... I've pretty much accepted the fact I would tackle it eventually. Thing is, the head dev at my company told me on Friday to "learn perl and php" when she finally saw my bash code. I'd like to stay away from the userland-ish web stuff as much as possible. I'm not anti-social myself, just not very user friendly

Python it is! Can you, or anyone else recommend an interface for Python development? I've been doing things in viM far too long...
 
Old 07-29-2007, 12:50 AM   #8
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

There's nothing wrong with vIM - that's my preference at least 80% of the time ;-)

Anyway, I think you might like pyDev, for Eclipse:

http://pydev.sourceforge.net/

Here are a couple of other links:
http://wiki.python.org/moin/Integrat...ntEnvironments
http://www.die-offenbachs.de/eric/index.html
http://dev.activegrid.com/community/

'Hope that helps .. PSM

PS:
Good luck - and have fun!
 
Old 07-30-2007, 05:28 AM   #9
paddy3118
LQ Newbie
 
Registered: Jul 2007
Location: Bristol UK
Distribution: RedHat, Cygwin
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by dave201
Python it is! Can you, or anyone else recommend an interface for Python development? I've been doing things in viM far too long...
Vim's good. I use a mixture of vim and idle mainly myself.
 
Old 07-30-2007, 08:48 AM   #10
sleepyEDB
Member
 
Registered: Dec 2005
Location: /USA/MI/Detroit/home
Distribution: MEPIS, antiX, RHEL
Posts: 105

Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by dave201
* a language that can work on a variety of platforms... not just i386 PCs; cellphones? (i'm thinking OpenMoko)
Bless your heart!


sleepy
 
Old 07-30-2007, 09:01 AM   #11
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
From what I read in your post, you're describing C. I've just started to study it ("for real") some time ago, and have used Python (and some others) before, and have to say that if I was to make a program that is likely to be distributed to somebody else than me myself, I'd definitely think about writing it in C. Python is good for a lot of stuff, but (at least as of now) it feels it's not for everything. It's handy for little tasks, and some big ones too, but like said, it's common to write parts of the big program in C (in the name of efficiency, for example) and then "glue it up" with Python. Good to know both.

There's nothing like Vim. After numerous editors and environments and this and that, I stumbled across Vim and started finding out how it works (before it's usage was plain hell to me) and today I can't think of much anything else, maybe Emacs, but apart from that.

Try C, at least. You'll learn Python in no time, but if you don't take time to learn C (it doesn't take that much either, though a little longer than Python) you could regret it some day when you don't have that time, just tasks.
 
Old 07-30-2007, 10:43 AM   #12
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
Quote:
Originally Posted by paulsm4
... <talked about python editors> ...
Also, check out Pida: http://pida.co.uk/ -- it's Vim wrapped in some extra features (literally -- it uses Vim as an embedded editor), written in Python and incorporating some Pythonic benefits.
 
Old 07-31-2007, 06:51 AM   #13
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,287

Rep: Reputation: 173Reputation: 173
Quote:
something (and I know this may sound bad) that I can make a decent living off of.
in this case, perl is much more ubiquitous than python.

go to your favourite job site and search python jobs.
which is why I chose perl over python even though I think python
is much more elegant.
 
Old 08-01-2007, 07:04 PM   #14
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
You are definitely going to generate a religious argument here, if anyone actually "bites." (Which is fairly unlikely.)

I do agree that "5,000 lines of bash" is a pretty-serious abuse of what bash was really intended for. It's supposed to be a shell, not a programming language.

I also agree that a high-level language is usually what is called-for. There are very few situations where you need to resort to "C" or "C++." Any high-level language system, be it Python or Perl or something-else, consists of tens of thousands of lines of "C" or "C++" code, all of which you can "simply use."

Realistically, in the Unix/Linux environment you are going to have to use both languages, so you may as well plan on learning both of them. It isn't hard. The more languages you know, the easier it is to grok the numerous similarities between all of them.

Given the choice, all things being equal, I have no doubt at all that you will consistently pick-up Python, and come to prefer it.
 
Old 08-02-2007, 05:32 AM   #15
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
I'd disagree with Perl not being fast. It's prob about 80-90% as fast as C.
I did C for about 8 yrs, then Perl for the last 6 or 7.
Never had a prob with performance that I couldn't solve with a better design/code.
It's certainly ubiquitous, even runs on VMS.
If you really want some definitve answers to what Perl is/isn't or can/can not do, ask at www.perlmonks.org, where the gurus hang out.
That said, it's pretty much your choice in most cases.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python or Perl drdroid Programming 29 12-22-2006 09:54 AM
Perl or Python JJX Programming 4 04-17-2006 02:42 PM
Python or Perl? Boby Programming 2 06-12-2005 10:54 AM
Perl or Python JJX Programming 6 10-27-2004 03:58 AM
Perl or Python ! linuxlover1 Programming 13 04-19-2004 07:33 AM


All times are GMT -5. The time now is 05:33 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration