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 8 1506
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...
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('@')])"
>>>>> "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
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
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('@')])"
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)?
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
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 :-) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Charles Rush |
last post by:
I have some bench time and want to pick up a new language to, perhaps,
reduce the amount of bench time in the future. To that end, I've been
looking at either the C#/.NET (VB/.NET?) thing with the...
|
by: RobertMaas |
last post by:
After many years of using LISP, I'm taking a class in Java and finding
the two roughly comparable in some ways and very different in other
ways. Each has a decent size library of useful utilities...
|
by: Spammay Blockay |
last post by:
I've been tasked with doing technical interviews at my company,
and I have generally ask a range of OO, Java, and "good programming
technique" concepts.
However, one of my favorite exercises I...
|
by: Maurice LING |
last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic
typing, is there any other real reasons that Python is slower than Java?
maurice
|
by: DrUg13 |
last post by:
In java, this seems so easy. You need a new object
Object test = new Object() gives me exactly what I want.
could someone please help me understand the different ways to do the
same thing in...
|
by: Michael B. |
last post by:
I was just thinking about this, specifically wondering if there's any
features that the C specification currently lacks, and which may be
included in some future standardization.
Of course, I...
|
by: Ding Lei |
last post by:
Dear fellows,
I am currently a Java programmer, using it for around 3 years, & felt quite
bored with it. IMHO, Java is too strict on lots of things, unlike Perl, There
is usually only one or two...
|
by: Michael |
last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP,
I am unable to find out why the "Build for Debug" option within Stored
Procedure Builder is not enabled on Java stored...
|
by: wellstone9912 |
last post by:
Java programmers seem to always be whining about how confusing and
overly complex C++ appears to them. I would like to introduce an
explanation for this. Is it possible that Java programmers...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |