Is python worth learning as a second language?

T

Tomasz Rola

Tomasz Rola a écrit :
(snip)


Arf - only took me 6 months !-)

I guess sometimes I need to be knocked really hard ;-/. But it works both
ways - I cannot imagine what should Java-the-language have to make me
interested again. Java-the-virtual-machine is still interesting a little,
but not as much as few years ago. Languages that I like (Python is one of
them) are already multiplatform, so running Jython is reserved to few very
special cases (those cases may be important and happening quite often to
other people but I intend to avoid them personally). Same for other
languages implemented over JVM, like Scheme or Common Lisp.

Of course, just my opinion.

Regards,
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] **
 
C

Craig Allen

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'm not even going to read the replies first because I have my own. I
was a C and C++ programmer exclusively for over a decade. During that
time I had a "whatever tool for the problem" approach to language
selection but C++ continued to be the best for the sort of thing I was
doing. During that time I continued to learn other languages at least
enough to consider them. I appreciated the role of interpreted
languages were filling, but also never felt comfortable in them.

Python, imo, is an excellent language to learn as a C++ programmer.
It is relatively easy to extend with C/C++ and so works together well.
When you find yourself writing some configuration language, you'll be
able to use python instead. Also, I have found that Python helped
open my mind a bit about object orientation and to realize that while
the compile-time decisions in C++ are great for the C/C++ linking
model, and provides a certain sort of power and control, that it also
really does (as many had complained to me) take a few blows at how you
really want OO to work.

So I love python's OO and things which can be done structurally in C++
(like metaclass programming) but with which the C++ syntax is not
cooperative, and which is very much harder to safely extend modularity
too (I could go into detail but why bother here, it's either already
clear what I mean or isn't that important)...

Finally, Python is a multiparadigmed language, like C++. It very much
seems to believe in Bjarne's original trust the programmer outlook on
languages. As a C++ programmer I enjoyed the responsibility and
power of choosing one's paradigms at the outset of a project. Such
choices are best made consciously, one learns a lot about their
project and develops a lot of philosophical standards for the design
and implementation by having to think first "what models and
programming paradigms will we adopt". It makes you think what sort of
code you will be writing often, and which idioms will be efficient and
maintainable.

Honestly, I've become more of a Python fan than I am really
comfortable with... it can't be as good as I think.

-craig
 
R

r

Honestly, I've become more of a Python fan than I am really
comfortable with... it can't be as good as I think.

-craig

Don't fight it, just go with it man... just go with it! *wink*
 
B

bubill

I'm a Testing Engineer ,i don't know any language at all before
learning py3k ,and for Testing job!
 
Z

ZikO

Well

What Can I say guys?

I really appreciate your help here. Thanks for your answers. I have read
all of them :p. Yes. Thanks for the websites: Dive In Python and
docs.python.org. And I most say I have been convinced to take it as
another tool for the programmer.

PS. Tomasz, thanks for pl.comp.lang.python I have been there and even
asked similar queastion =). Regards/Pozdrawiam
 
G

grkuntzmd

The other day one of our developers said that he thought learning
assembler language in college was a total waste of time. I can't
disagree more.

Even if assembler language is specific to one architecture, the
principles that it teaches are universal and fundamental to all other
programming languages.

Besides, programming in assembler can be fun, in a sick sort of
way... :)
 
T

Tomasz Rola

--===============0027953262==



That long? It only took me six minutes.

Guess what, there was a time when Java was looking quite promising.
Especially in the field of distributed computing (which then meant not
only high performance clusters). And computers were of more than one type,
used other cpus than Intel, too.

Maybe it's easier to ridicule Java now, when it has not met the
expectations. But still, some people (better than I) have spent few
years writing software and doing their research in Java. Sure, that was
before Java had been nominated the common denominator of programming
languages.

Regards,
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] **
 
A

Aahz

Guess what, there was a time when Java was looking quite promising.
Especially in the field of distributed computing (which then meant not
only high performance clusters). And computers were of more than one type,
used other cpus than Intel, too.

Maybe it's easier to ridicule Java now, when it has not met the
expectations. But still, some people (better than I) have spent few
years writing software and doing their research in Java. Sure, that was
before Java had been nominated the common denominator of programming
languages.

So? By the time Java was released, Python had already been around for
several years. Taking C++ and turning it into a VM model does not
exactly strike me as particularly good use of resources.
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Programming language design is not a rational science. Most reasoning
about it is at best rationalization of gut feelings, and at worst plain
wrong." --GvR, python-ideas, 2009-3-1
 
T

Tomasz Rola

--===============0836317661==

So? By the time Java was released, Python had already been around for
several years.

I've started to use Python around 1.5. If it could interest me more than
Java earlier than that, I don't know.
Taking C++ and turning it into a VM model does not
exactly strike me as particularly good use of resources.

It doesn't strike me either. But resources are not the only dimension of
judging the language, you know.

Also, I never actually liked the idea of dumbing down C++.

But, as I said, Java had some weight in the past (and some promises have
been made about its future and not kept). I felt that dismissing it "after
six minutes" might have been a little bit unfair. You should have done it
after a week.

:).

BTW, if you spent a day on this, you could learn about few other Java
implementations, some of them not so resource hungry. Not that it makes
Java much better, but your choice could be better informed. Eh, English -
not sure if it is really what I've wanted to say :).

Regards
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] **
 
A

Aahz

It doesn't strike me either. But resources are not the only dimension of
judging the language, you know.

You misunderstand me: I was talking about the resources (people and
money) used to create Java.
But, as I said, Java had some weight in the past (and some promises have
been made about its future and not kept). I felt that dismissing it "after
six minutes" might have been a little bit unfair. You should have done it
after a week.

:).

Java is yet another language with heavy static typing and an
object-oriented focus. What should have caused me to waste more time
before dismissing it?
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Programming language design is not a rational science. Most reasoning
about it is at best rationalization of gut feelings, and at worst plain
wrong." --GvR, python-ideas, 2009-3-1
 
T

Tomasz Rola

You misunderstand me: I was talking about the resources (people and
money) used to create Java.

Ah, I see now. From my perspective, it depends on how things ended. Since
Java went into VB-like direction, I think I can agree. They have to go
deeper and deeper into this... dead end (business decisions and the like).
But it wasn't always looking as bad as now, so, you know, it is always
easy to judge past, especially knowing that something was a failure. As I
was reading about Java's prospects long ago, the use of people and money
by Sun seemed like quite good way of spending resources (not best, but
justified). In my opinion, it was the direction Java took somewhere around
dot com burst that has really sinked it (namely, letting go of innovating
aspect and pushing Java as, pardon the word, "business-level solution").
Java is yet another language with heavy static typing and an
object-oriented focus. What should have caused me to waste more time
before dismissing it?

Really, I don't know. From how you wrote it, seems you had not much need
to investigate the subject. So, since you did not feel such need in the
first place, it could be difficult to convince you.

It really depends on what kind of programs you write (or are going to
write). For me, there are some cases, when I would at least consider Java
during design phase:

1. Writing code that has to be, umh, mobile (not in a cell phone sense).
Working on a network, sending code to other nodes. Special case - when
this code has to do some computations, not heavy enough to justify using
C, but still enough so that JIT is an advantage (even though JIT may not
be available on every node type). And, of course, having a C compiler on
every node is not always feasible. My favourites at the moment would be:

- Scheme. PLT Scheme has JIT and is my current workhorse language. It is
possible to find other Scheme flavors on almost any >=32-bit cpu. Cons:
all those flavors, albeit very similar and based on well defined common
standard - to be frank, not so common anymore, but this is irrelevant -
are still a bit different which can get problematic).

- Java. Has JIT and is quite ubiquitous, from mainframes to cellphones.
Cons: different Java flavors, EE, SE, MIDP... are quite different and
their common subset is too simple for my taste.

- Python. I like it more than Java, sometimes it is possible to use JIT.
Still, the fact that I like it does not always help enough to use it.

- Erlang? Who knows, I would have to read more about it first.

2. Using code written in few different languages:

- Common Lisp. Right now, I don't actually feel like I can program in it,
but from what I have read here and there, hacking REPL into accepting
foreign code is a lot of fun and adventure, so if only I had enough time
to learn, I would go for it, I suppose. Also, there is a possibility
(theoretical at least) to compile the whole shebang into native code.

- Java. As a platform, Java has a number of other languages
implementations on top of its JVM. They are a bit slow from what I read
but they are here long enough to be considered stable and/or mature.

- Python is not a big contender here, it is not a platform. It is still
possible to glue different libraries and interpreters with it (like Sage),
but this is not always convenient.

- Mono. I know it not well enough to consider its use. But maybe, maybe.

I hope this answered your question, at least partially. Learning Java as a
good Python or anything replacement is not a case, I think. However,
learning about it to have more choices is rather good idea. At least I
myself am not too sorry about knowing Java, maybe I should have just
jumped off its vagon a year or two earlier than I did.

BTW, I realise that there may be some costly alternatives to everything I
wrote above. But I am not interested so I would not consider them :),

Regards,
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] **
 
T

Tomasz Rola

I've only read he subject and a few lines from other responses.

yes, it is worth learning. I came from PHP to Python. It's very powerful and
makes application development easier for me than in PHP and/or C#, but bash,
well that depends on the type of bash. It has a lot of diffent ways you can
use it too, so that adds to how powerful it is.

IMHO, Bash is great for quick and dirty hacks, as a kind of simplified
Perl. But when bash script grows too big, I would consider rewriting it in
Python rather than Perl. But this is just my personal choice.

Since we are already a little offtopic :), did you see any speed
difference between PHP and Python? I understand, that you are doing web
devel in those two?

Regards,
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] **
 
T

Tomasz Rola

I really can't say too much about speed increase or decrease, it really
depends on the site and how its built, what libs are used and how they are
loaded, same thing in PHP, It would be difficult for me to same anything on
speed because of that. I built a templated modulated cms in CodeIgniter(PHP
MVC), google it, It is a base for a templated system. using smarty and ci
templating syntax, although the smarty side of things makes it slower I
think. Also it is modulated, which breaks up your code into modules that you
can load on the page into a div with ajax, preferrably jquery but you can
use any framework for that too

I see. Thanks for answering.

Regards,
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] **
 

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

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,202
Latest member
ClaudioVil

Latest Threads

Top