LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 03-15-2014, 08:54 AM   #1
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Rep: Reputation: 98
Thoughts on Python?


Seems that I have not kept up with evolution. I get the impression that Python may be the programming language of preference today. Basic seems to have "died-out". What are your thoughts?
 
Old 03-15-2014, 09:35 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i think python is the soup-du-jour... i never done much basic but it seems relegated to excel macros.

i hacked together a few xbmc programs in python. it seems useful in certain environments but i am sticking with c for the time being.

i never had a need for oop (c++) and i never liked java since it is limeted to only running on jvm and is kinda' sluggish.

Last edited by schneidz; 03-15-2014 at 09:41 AM.
 
Old 03-15-2014, 10:46 AM   #3
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Original Poster
Rep: Reputation: 98
My programming has been limited to incidental projects. Most of it VBA with MS Access, so I didn't pay much attention to programming evolution. Now that I am doing Linux (Ubuntu) I have noticed a dearth of references to Basic with Python being the Soup-du-jour, as you point out. Looks like I will be investing in a Python (hardbound) book. I do have the PDF manual, which I recently downloaded.

PS: Irony, after posting, I ran across this article "A Tiny Python Panadapter" in the April 2014 edition of QST magazine! So Python is being used for custom Linux based uses in Amateur Radio.

Last edited by Steve R.; 03-15-2014 at 11:10 AM.
 
Old 03-15-2014, 12:11 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Given the rate at which Python has been changing, a hardbound book might prove to be painfully out of date. There are up-to-date instructional books available online, though personally, every time I try to Dive Into Python I end up as a lump in the middle of a snake.
 
Old 03-15-2014, 12:43 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
I think Python is great.

These free books should be good to start with:

http://www.greenteapress.com/thinkpython/
http://swaroopch.com/notes/python/
http://learnpythonthehardway.org/book/

Quote:
Originally Posted by Steve R. View Post
PS: Irony, after posting, I ran across this article "A Tiny Python Panadapter" in the April 2014 edition of QST magazine! So Python is being used for custom Linux based uses in Amateur Radio.
Python is heavily used in film production (animation and VFX) and in scientific computing, it has excellent support for the rasberry pi, and it's an equally excellent choice for web development. On Linux, it's also IMHO the best way to write desktop applications.

Last edited by dugan; 03-15-2014 at 12:48 PM.
 
Old 03-15-2014, 05:31 PM   #6
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by dugan View Post
... and it's an equally excellent choice for web development.
In following your links, I had an epiphany of sorts. PHP or Python to connect to MySQL with a browser (Firefox)? I've already set-up MySQl as the back-end database and I am currently using MS Access as the front-end, which I am planning to dump. My idea was to learn PHP and use it as the new front-end. Would Python be an alternative?


Quote:
Originally Posted by dugan View Post
... it has excellent support for the rasberry pi, ...
The author of "A Tiny Python Panadapter" referenced the Raspberry Pi and BeagleBone Black. Even had a picture of the Rasberry Pi. A whole new world awaits. Thanks.

Last edited by Steve R.; 03-15-2014 at 06:06 PM.
 
Old 03-15-2014, 07:14 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by Steve R. View Post
In following your links, I had an epiphany of sorts. PHP or Python to connect to MySQL with a browser (Firefox)? I've already set-up MySQl as the back-end database and I am currently using MS Access as the front-end, which I am planning to dump. My idea was to learn PHP and use it as the new front-end. Would Python be an alternative?
Let me make that a very, very emphatic yes!

https://www.djangoproject.com/

The tutorial (there's a link on the front page) takes less than an hour to go through.

You get the benefit of the Python language, which is much more consistent and easier to work with than PHP, and you get Python's standard library, which is second to none.

Last edited by dugan; 03-15-2014 at 07:16 PM.
 
Old 03-15-2014, 07:43 PM   #8
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Original Poster
Rep: Reputation: 98
Thanks.
 
Old 03-17-2014, 06:55 AM   #9
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Keep this in mind ... programming languages do not "die out."

Always, IMHO, the best thing that you can do for your ongoing career is to familiarize yourself with another one. (Another language that is, not another career ... ... well, maybe.)

I recently worked on a COBOL project, in which COBOL was driving a very large IBM mainframe computer to do the very thing that IBM mainframes and COBOL [still ...] does best. Astonishing quantities of transactional information were being processed every millisecond, with absolute control as to the handling of fractional dollars-and-cents. Priceless.™ It was, and still is, the right combination for this job ... can you apply for the gig?

Every language, including non-procedural ones like "R" and "Prolog," tells the computer to solve problems ... yet, does so in a different way. These make them suitable (as they are expressly intened to be suitable) for different kinds of problems. You will learn a lot about those problems by learning a language's approach to solving them. Furthermore, and I can flatly tell you this from [decades of ...] experience, you will encounter legacy systems which were built in a combination of languages, and the fact that you can truthfully say (don't even try to bluff!) that you're familiar with them might just be the ticket that opens a door for you.

This is an indication of depth of experience, and I can also tell you that most programmers whose resumes I see, simply do not have "depth" (yet). You don't have to have created some major system in it ... such opportunities are not strictly under your control ... but you can rummage systematically through "the programmer's great tool-box" and get to know the many things that are inside. Don't expect someone to pay you to do it, either. Don't ask someone to give you an "attaboy" (a certificate). This is self-improvement. Professional development in your chosen field.

Last edited by sundialsvcs; 03-17-2014 at 06:59 AM.
 
Old 03-17-2014, 08:55 AM   #10
mina86
Member
 
Registered: Aug 2008
Distribution: Debian
Posts: 517

Rep: Reputation: 229Reputation: 229Reputation: 229
Before starting with Python I was very optimistic, but it failed my first impressions (if you know Polish you can read about them on my blog). Now I'm programming quite a bit in Python and my opinion about it did not improve. I think it's a terrible language, yet it's still one of the best scripting languages, which makes the whole situation sad.

So if you are looking for a scripting language to learn sure go ahead with Python or Perl (despite the fact that hating Perl seems to be what cool kids are doing now, I don't think it's any worse than Python), but once you reach dozen hundreds of lines or so switch to C++.

Unless you're writing for the web in which case you're screwed as far as I can tell.

Quote:
Originally Posted by Steve R. View Post
My idea was to learn PHP and use it as the new front-end. Would Python be an alternative?
Yes it would! And Python would be a much better alternative!

Last edited by mina86; 03-17-2014 at 08:58 AM.
 
Old 03-17-2014, 12:34 PM   #11
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi

I just want to add that if you plan to do web development, I suggest learning Javascript. It's not because it's a good scripting language, but it's the only thing that's available in browsers. For advanced web pages, there simply is no alternative.

Not long ago, we had to use a different language for the server side stuff. Now we have node.js so we can use it on the server too.

Very often it's quite different things being done on the server compared to the browser. But a project usually have lots of functions and things you do on both. So a lot of code can be put in include files included by both.

It's easier to learn one language. And I think better to know one language well, than to know many languages half-way.
 
Old 03-17-2014, 01:21 PM   #12
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Mint 20.3
Posts: 521

Original Poster
Rep: Reputation: 98
Quote:
Originally Posted by sundialsvcs View Post
Keep this in mind ... programming languages do not "die out."
Bad choice of words on my part. Still do any programming in CP/M?

Quote:
Originally Posted by sundialsvcs View Post
I recently worked on a COBOL project, in which COBOL was driving a very large IBM mainframe computer to do the very thing that IBM mainframes and COBOL [still ...] does best. Astonishing quantities of transactional information were being processed every millisecond, with absolute control as to the handling of fractional dollars-and-cents. Priceless.™ It was, and still is, the right combination for this job ... can you apply for the gig?
I understand that those familiar with COBOL can now get paid a premium since there are so few left who know it. I don't know if it is still true or not, its been a few years since I heard that.

To make a very long convoluted story extremely short. A consulting firm was hired (circa 1990) to develop a mainframe database application. They developed a flat database that utilized batch processing. At the time, personal computers with dBase were being introduced. As staff got access to personal computers they (secretly) minimized their use of the mainframe database in favor of PC based solutions. Unbelievable, that a consulting firm essentially dumped on us an obsolete difficult to use design for what should have been an easy to use relational database.

Last edited by Steve R.; 03-17-2014 at 01:41 PM.
 
Old 03-17-2014, 08:35 PM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
(Shrug ...) "Yeah, they're still out there." I'm sure it must be true. But, I'm sure that the exact story(!!) could be told in the context of the present day, with nothing more than a simple substitution of dates and programming-language names.

Face it, within our most-curious business, we are all simply "trying to make computing-machines do useful things for real people." (And to somehow get paid for our time. Heh.)

Sometimes, what we are attempting to do is "altogether new." And sometimes, it most-decidedly is not. Sometimes, COBOL (still ...!) is "the tool of choice!"

If you want to do dollars-and-cents calculations with arbitary precision such that "float-decimal data types simply won't do ..." lend an ear, my good friend, towards what this "oldy moldy" (sic!!) tool can still do! And is still doing!! ("Bah! These kids today!!") Rear Admiral Grace Murray Hopper was not wrong, "way back then."(And yes, I have one of her eleven-inch long "nanoseconds" as one of my most prized possessions.)

Right now, I'm bidding on a major project that, if I land it, will be (and should(!) be) "COBOL [almost] all the way!"

The more times you do it, and the more "different" times you do it ... (yes, and I am not afraid to say it, 'over however-many decades' ...) ... the more you realize that whatever you are doing now isn't, actually, "remarkably different than before." <<PHP | Perl | Python | Ruby | VB >> simply aren't "remarkably different." (Yet, say, Prolog, is.)

That, to me, is one of the remarkable aspects of this business: "first, you get to choose," and your choices never are limited by history. Yes, indeed: the technical choices that were made forty(!) years ago are not necessarily wrong today: they're just surrounded by more and more context. As you self-expand your knowledge to incorporate more and more programming-language tools, and thereby regard them in ever-greater context, you will see for yourself first-hand just what I mean.

"Hang on! All of us are [Still!!] part of a one-of-a-kind profession, the likes of which have never before existed!" Enjoy!

Last edited by sundialsvcs; 03-17-2014 at 08:51 PM.
 
Old 03-17-2014, 08:54 PM   #14
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I think you need to be a bit more specific about what you want from a language.

My thoughts on Python ... it's a fad. It's not backwards compatible, it's not well designed, it's not efficient, and it's not good for anything in particular (you can't write anything in python that couldn't be written better and more efficiently in another language). Ruby is part of the group of such languages.

Not intending to start a flame war, you just asked for my thoughts.
 
Old 03-18-2014, 02:26 AM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by metaschima View Post
My thoughts on Python ... it's a fad.
It's older than Java.

Quote:
it's not well designed
And why do you say that?

For the rest, thank you for your thoughts; you already know mine.
 
  


Reply



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
LXer: Python wins trademark dispute, rival stops calling itself “Python” LXer Syndicated Linux News 0 03-21-2013 07:40 PM
Python 2.6 dependencies error installing python-sqlite2-2.5.5-1.1.i586.rpm jmp007 Linux - Newbie 1 02-11-2011 11:05 AM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM
thoughts on C/C++ vs. Python for personal programming servnov Programming 3 02-28-2005 10:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration