By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,783 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

Suggestions for a Java programmer

P: n/a
Ray
Hello there,

I've been programming in Java for about 8 years now, but lately I've
been hearing a lot about Python and I'm really interested in learning
more about it. I've read the tutorial, and some books (core python
programming is one), but there's one thing that's still missing: how to
use Python the "Python" way.

I found learning C# was a breeze for me because the language shares a
lot of concepts and notions with Java--I can always say: "I do X this
way in Java, I should be able to do X this way too in C#", and usually
I'm not far off the mark.

But Python is different enough that, even though some basic concepts do
translate easily, idioms and effective usage of it don't come easy. I
can't help thinking that when I'm writing Python, I'm actually writing
Java in Python. Not Python in Python.

Can you point me to "Python for Java Programmers" resources? I found
one blog, but that only touched the tip of the iceberg, I feel. I know
that as I use Python more and read more books and read how experienced
Python programmers code, eventually I'll find it out. But I'd like to
expedite that process if possible. What are your suggestions?

Thank you!
Ray

Jul 18 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
<ra********@yahoo.com> might have written:
Can you point me to "Python for Java Programmers" resources? I found
one blog, but that only touched the tip of the iceberg, I feel. I know
that as I use Python more and read more books and read how experienced
Python programmers code, eventually I'll find it out. But I'd like to
expedite that process if possible. What are your suggestions?


Searching google for "python for java programmers" (without the quotes)
produces:

Python for Java programmers - Irmen's Python wiki
Python & Java: Side by Side Comparison
Jython Home Page (which you might like a lot)
dirtSimple.org: Python Is Not Java (some useful pointers)

among others. You didn't specify which blog you found, so HTH.
--
TZOTZIOY, I speak England very best.
"Be strict when sending and tolerant when receiving." (from RFC1958)
I really should keep that in mind when talking with people, actually...
Jul 18 '05 #2

P: n/a
Ray wrote:
Hello there,

I've been programming in Java for about 8 years now, but lately I've
been hearing a lot about Python and I'm really interested in learning
more about it. I've read the tutorial, and some books (core python
programming is one), but there's one thing that's still missing: how to
use Python the "Python" way.

I found learning C# was a breeze for me because the language shares a
lot of concepts and notions with Java--I can always say: "I do X this
way in Java, I should be able to do X this way too in C#", and usually
I'm not far off the mark.

But Python is different enough that, even though some basic concepts do
translate easily, idioms and effective usage of it don't come easy. I
can't help thinking that when I'm writing Python, I'm actually writing
Java in Python. Not Python in Python.

Can you point me to "Python for Java Programmers" resources? I found
one blog, but that only touched the tip of the iceberg, I feel. I know
that as I use Python more and read more books and read how experienced
Python programmers code, eventually I'll find it out. But I'd like to
expedite that process if possible. What are your suggestions?


These two books should help you to get a grasp of Pythonic idioms:

http://www.mindview.net/Books/TIPython
http://diveintopython.org/

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Jul 18 '05 #3

P: n/a
>>>>> "bruno" == bruno modulix <on***@xiludom.gro> writes:

bruno> These two books should help you to get a grasp of Pythonic idioms:

....

Regarding a Java programmer moving to Python, a lot of the mindset
change is about the abundant use of built in data types of Python. So
a Java programmer, when confronted with a problem, should think "how
can I solve this using lists, dicts and tuples?" (and perhaps also my
new favourite, sets). Class-based solution should be chosen only after
seeing that the problem can't be trivially solved with built-in types.

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #4

P: n/a
Ray
Hi Christos,

Christos TZOTZIOY Georgiou wrote:
On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
<ra********@yahoo.com> might have written:

Searching google for "python for java programmers" (without the quotes) produces:

Python for Java programmers - Irmen's Python wiki
Yes, I feel that this wiki touches more on how Java compares to Python
(as opposed to how to *think* in Python). Maybe I should get the Python
Cookbook to absorb more of the Python way of thinking, you think?
Python & Java: Side by Side Comparison
This also compares Java & Python, the differences of which I am already
aware of.
Jython Home Page (which you might like a lot)
Thanks, I've used it before, but I feel that I was using it to "write
Java in Python"
dirtSimple.org: Python Is Not Java (some useful pointers)


This is the one I was referring to. I'm looking for something like this
(how some common idioms in Java is not the best way to do it in Python,
and how to do things the Python way).

Thanks!
Ray

Jul 18 '05 #5

P: n/a
Ray

bruno modulix wrote:
These two books should help you to get a grasp of Pythonic idioms:

http://www.mindview.net/Books/TIPython
Will read this later.
http://diveintopython.org/
I just downloaded this one and am reading it now. Thanks bruno!

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in 'o****@xiludom.gro'.split('@')])"


Jul 18 '05 #6

P: n/a
Ray

Ville Vainio wrote:
Regarding a Java programmer moving to Python, a lot of the mindset
change is about the abundant use of built in data types of Python. So
a Java programmer, when confronted with a problem, should think "how
can I solve this using lists, dicts and tuples?" (and perhaps also my
new favourite, sets). Class-based solution should be chosen only after seeing that the problem can't be trivially solved with built-in

types.

Hmmm, but isn't it the same as a Java programmer who's familiar with
the Collection Framework? (Which has list, dict (map), and set)?

Jul 18 '05 #7

P: n/a
Ray wrote:
Ville Vainio wrote:
Regarding a Java programmer moving to Python, a lot of the mindset
change is about the abundant use of built in data types of Python. So
a Java programmer, when confronted with a problem, should think "how
can I solve this using lists, dicts and tuples?" (and perhaps also my
new favourite, sets). Class-based solution should be chosen only


after
seeing that the problem can't be trivially solved with built-in


types.

Hmmm, but isn't it the same as a Java programmer who's familiar with
the Collection Framework? (Which has list, dict (map), and set)?


Python collections are vastly easier to work with. In particular for creating, iterating and nesting
collections there is really no comparison between Python and Java. As a result, my Python programs
use collections much more than Java programs.

To respond to the OP, I recommend the book "Python Cookbook" as a way to learn the Pythonic view. It
doesn't contrast Python with Java, but it gives many examples of idiomatic Python

Kent
Jul 18 '05 #8

P: n/a
On Thu, 24 Mar 2005 00:22:09 -0800, Ray wrote:
Can you point me to "Python for Java Programmers" resources? I found one
blog, but that only touched the tip of the iceberg, I feel. I know that as
I use Python more and read more books and read how experienced Python
programmers code, eventually I'll find it out. But I'd like to expedite
that process if possible. What are your suggestions?


Also don't be afraid to post a "this ought to be easier" post here. While
it will most like rapidly turn into an unofficial contest for regulars to
post the niftiest solution, the first few messages will be helpful, and
you'll leave Google fodder for future people with that concern. And
besides, the contest might teach you several other things as well.
Basically, everybody wins :-)
Jul 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.