Is python worth learning as a second language?

Z

ZikO

Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else
because I know second language might be very helpful somehow. I have
heard a few positive things about Python but I have never writen any
single line in python so I do not know this language at all.

Do you think python would be good complementary language for C++? Do you
think it's worth learning it or let's say try Java? and how difficult it
would be for me if I know C++ pretty well I would say?

Thanks
 
B

Bo¹tjan Jerko

Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else
because I know second language might be very helpful somehow. I have
heard a few positive things about Python but I have never writen any
single line in python so I do not know this language at all.

Do you think python would be good complementary language for C++? Do
you think it's worth learning it or let's say try Java? and how
difficult it would be for me if I know C++ pretty well I would say?

Thanks

I've tried different languages (being mostly C programer at the time)
- even Java. Tried Python and stayed with it.
Other than that - the best language is the language you know.

B.
 
B

bearophileHUGS

ZikO, if you know C++, then knowing one scripting language is useful,
it can be Ruby, Python (or even Lua, etc).
Note that learning a language isn't a binary thing, so I suggest you
to use a week to learn Python and use it try to solve some of your
practical problems. After a week you will be able to tell if it's
useful for you.

Bye,
bearophile
 
C

Chris Rebert

Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else because I
know second language might be very helpful somehow. I have heard a few
positive things about Python but I have never writen any single line in
python so I do not know this language at all.

Do you think python would be good complementary language for C++?

Yes, because Python is often used as a "glue" language used to script
C(++) components. Also, it's significantly different than C++ so it
will be a valuable learning experience that will expand your horizons.
Do you
think it's worth learning it or let's say try Java? and how difficult it
would be for me if I know C++ pretty well I would say?

I would say Java would be comparatively less worth it since it's so
similar to C++ already; you could pick it up in just a few days. If
you're going to learn a new language, you might as well learn a
drastically different one.

Cheers,
Chris
 
L

Lie Ryan

ZikO said:
Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else
because I know second language might be very helpful somehow. I have
heard a few positive things about Python but I have never writen any
single line in python so I do not know this language at all.

Do you think python would be good complementary language for C++? Do you
think it's worth learning it or let's say try Java? and how difficult it
would be for me if I know C++ pretty well I would say?

Thanks

Certainly. A programmer that only knows one language would be too
limited. Try as many programming language as you can, and especially
look for programming languages that have "obscenely different" paradigm
than the language you already know.

You should know at least a language from each categories (anyone can add
if they feel something is missing):

- Object oriented, example: C-family, Java, Python, etc
- Imperative, example: C-family, Java, Python, etc
- Functional, example: Python, Lisp/Scheme, Haskell, etc
- Declarative, example: Haskell, Prolog
- Logic Programming, example: Prolog, etc
- Event driven, example: most GUI sublanguage, etc
- Domain specific language, example: Regular Expression (yes it is a
programming language, regex parser is a Finite State Machine), SQL, etc
- Concurrent programming, example: Erlang, etc
- any other paradigms

so basically, I still have much to learn...
 
T

Tim Wintle

Certainly. A programmer that only knows one language would be too
limited. Try as many programming language as you can, and especially
look for programming languages that have "obscenely different" paradigm
than the language you already know. I completely agree

You should know at least a language from each categories (anyone can add
if they feel something is missing):
- Object oriented, example: C-family, Java, Python, etc
- Imperative, example: C-family, Java, Python, etc
- Functional, example: Python, Lisp/Scheme, Haskell, etc
- Declarative, example: Haskell, Prolog
- Logic Programming, example: Prolog, etc
- Event driven, example: most GUI sublanguage, etc
- Domain specific language, example: Regular Expression (yes it is a
programming language, regex parser is a Finite State Machine), SQL, etc
- Concurrent programming, example: Erlang, etc
- any other paradigms

My slight issue with this list that I think things are in too many
places. E.g. although you can do functional programming in Python (and
many do), I think it's worth trying to learn a language like lisp just
for the sake of forcing yourself to fully understand the paradigm.

I also think it's worth writing simple programs in a low level - either
in assembly, or as Turing/Register machine code.

so basically, I still have much to learn...

so do I!
 
G

Geoff Smith

Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else
because I know second language might be very helpful somehow. I have
heard a few positive things about Python but I have never writen any
single line in python so I do not know this language at all.

Do you think python would be good complementary language for C++? Do you
think it's worth learning it or let's say try Java? and how difficult it
would be for me if I know C++ pretty well I would say?

Thanks

Every response is going to be pure opinion, of course. But learning
multiple languages that have different primary purposes is always a good
thing.

Python would be an excellent choice to supplement your C++. There are
other languages that might suit you better if you have more directed
needs in mind. But as a general use language, I doubt that Python would
disappoint. It is extremely functional and powerful, but still simple
enough that I generally recommend it as a FIRST language for those who
want to learn programming.
 
B

Bruno Desthuilliers

ZikO a écrit :
Hi

I hope I won't sound trivial with asking my question.

I am a C++ programmer and I am thinking of learning something else
because I know second language might be very helpful somehow.

Indeed. FWIW, I use about four programming languages on a daily basis -
plus "non-programming languages" like SQL, CSS, (x)HTML etc, know at
least four others enough to be able to read code and do simple
maintainance, and have been studying (at least enough to get a general
feel and have a general understanding) half a dozen other languages.

Learning a new languages serves two purposes:
1/ add another tool to your toolbox, so you have the right tool for the
job (I definitively wouldn't use C++ for web programming or sysadmin
scripting)
2/ learn new concepts and idioms (and this can be invaluable, at least
if you hope to become a better programmer).
I have
heard a few positive things about Python but I have never writen any
single line in python so I do not know this language at all.

Quite a lot of Python users come from other languages - mainly C, C++,
Java and Lisp, and these last times from PHP too thanks to Django.

If you're already an experimented programmer, specially from a C/C++
background, getting started with Python should be really easy. I guess
your main problem will be the mental adjustement needed to work *with*
the language instead of fighting *against* it.
Do you think python would be good complementary language for C++?

Quite a few C++ programmers here seems to think it's the case.
Do you
think it's worth learning it or let's say try Java?

Java being mostly a stripped down version version of C++, and not being
usable as a glue or scripting language, I don't think you'd get any
benefices from learning it.
and how difficult it
would be for me if I know C++ pretty well I would say?

cf above. As I said, the hard part will be to stop trying to forcefit
C++ concepts and idioms in Python - as usual when learning a somewhat
different language. FWIW, learning Python 101 is a matter of days, but
it took me months to get rid of the declarative-static-typing /
defensive-programming mental straightjacket. Seems like some never get
past this point...

HTH
 
M

Michele Simionato

My slight issue with this list that I think things are in too many
places. E.g. although you can do functional programming in Python (and
many do), I think it's worth trying to learn a language like lisp just
for the sake of forcing yourself to fully understand the paradigm.

By a curious accident, just today I was closing my cycle of posts
about functional
programming (http://www.artima.com/weblogs/viewpost.jsp?thread=251159)
with this note:

"""
The intention of this third cycle of Adventures was just to give a
feeling of what does it mean to be a true functional language, versus
being an imperative language with a few functional-looking constructs.
"""

Indeed Python is not a functional language and that if your goal is to
learn
the functional paradigm you should look at Haskell, ML or Scheme.
 
L

Lie Ryan

Yeah, that issue did pass through my head when I posted it, but I was
too lazy to do proper listing of various language from various
paradigms. I thought if he is really interested in a paradigm, he should
find the entry for the paradigm in google or wikipedia to get more
insight and example language.
By a curious accident, just today I was closing my cycle of posts
about functional
programming (http://www.artima.com/weblogs/viewpost.jsp?thread=251159)
with this note:

"""
The intention of this third cycle of Adventures was just to give a
feeling of what does it mean to be a true functional language, versus
being an imperative language with a few functional-looking constructs.
"""

Indeed Python is not a functional language and that if your goal is to
learn
the functional paradigm you should look at Haskell, ML or Scheme.

Definitely.
 
M

Marco Mariani

ZikO said:
Do you think python would be good complementary language for C++? Do you
think it's worth learning it

Absolutely, but it tends to become the first language over time.

Don't underestimate its reach. I've re-learned Python 3 or 4 times
already, over 11 years :-/
 
B

Bruno Desthuilliers

Grant Edwards a écrit :
(snip)
Knowing C++ does tend to be a bit of a handicap, but I think
any competent programmer could learn Python.

+2 QOTW !-)
 
T

Tim Rowe

2009/3/9 ZikO said:
Do you think python would be good complementary language for C++? Do you
think it's worth learning it or let's say try Java? and how difficult it
would be for me if I know C++ pretty well I would say?

We're not exactly impartial advisors in here ;-)

I reckon Python and C++ make a good pairing, because:

- Python is far enough from C++ for each language to give you things
that the other doesn't (as opposed to Java; if I were still a C++
programmer I would only be interested in Java as a replacement for
C++, not to use alongside it);

- Python is far enough from C++ for you not to get confused over the
syntax; when I was learning Java I kept forgetting it wasn't C++ and
throwing in bits of C++ code! That never happened with Python

- Python integrates well with C++, at least for single-thread systems.

Python has a fairly shallow learning curve -- a reasonable programmer
can become productive in Python very quickly. For one programmer's
experience of learning Python have a look at
http://www.python.org/about/success/esr/ (although I grant that Eric
Raymond might count slightly higher than just a /reasonable/
programmer!)
 
D

David Cournapeau

What about the stuff on docs.python.org? Isn't that information just
as reliable?

They do not serve the same purpose. diveintopython is an excellent
introduction to python for someone already familiar with at least one
programming language, and the documentation on python.org aims at
being extensive.

cheers,

David
 
T

Tomasz Rola

Hi
[...]

Do you think python would be good complementary language for C++?

Yes, definitely.
Do you think it's worth learning it or let's say try Java?

I may not be objective (tried Java, hated it after 6 years). In the long
run, I'm afraid Java is going to slide into being Cobol/Visual Basic of
the future. I mean, not really fun anymore. Some people want fun and some
other don't care.
and how difficult it would be
for me if I know C++ pretty well I would say?

Easy :).

One day of reading this, for a start:

http://docs.python.org/tutorial/index.html

and later:

http://docs.python.org/
http://diveintopython.org/

pl.comp.lang.python ;-)

Regards/Pozdrawiam,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature. **
** As the answer, master did "rm -rif" on the programmer's home **
** directory. And then the C programmer became enlightened... **
** **
** Tomasz Rola mailto:[email protected] **
 
B

Bruno Desthuilliers

David Cournapeau a écrit :
They do not serve the same purpose. diveintopython is an excellent
introduction to python for someone already familiar with at least one
programming language, and the documentation on python.org aims at
being extensive.

I first learned Python using the official tutorial - already knew VB,
Java, Pascal, bits of C and C++ and some almost unknown crappy
proprietary basic-like language - and I found it a pretty good
introduction to what one *must* know about Python.

But YMMV of course - and I'm by no mean saying DIP is a bad book !-)
 
G

grocery_stocker

David Cournapeau a écrit :



I first learned Python using the official tutorial - already knew VB,
Java, Pascal, bits of C and C++ and some almost unknown crappy
proprietary basic-like language - and I found it a pretty good
introduction to what one *must* know about Python.

But YMMV of course - and I'm by no mean saying DIP is a bad book !-)

Yeah, I'm learning the language alreadying knowing scheme, haskell,
some perl, and enough C to get me by.
 
R

r

Is python worth learning as a second language?

Short answer:
Yes

Long answer:
'Ye%s' %'s'*1000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top