473,698 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Suggestions for a Java programmer

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
8 1523
On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
<ra********@yah oo.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
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
>>>>> "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
Ray
Hi Christos,

Christos TZOTZIOY Georgiou wrote:
On 24 Mar 2005 00:22:09 -0800, rumours say that "Ray"
<ra********@yah oo.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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2873
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 goal of getting an MCAD, or going the JAVA route getting a Sun certification. What do you think? Is the Sun training the best for JAVA? What about C# or VB training? A little background. I've been a programmer for about 20 years with...
73
8016
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 as a standard portable part of the core language, the LISP package, and the java.lang package, respectively. Both have big integers, although only LISP has rationals as far as I can tell. Because CL supports keyword arguments, it has a wider range...
54
17400
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 give interviewees seems to trip them up all the time, and I wonder if I'm being too much of a hardass... it seems easy enough to ME, but these guys, when I get them up to the whiteboard, seem to get really confused. The exercise is this:
114
9841
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
11
9252
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 C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
193
9565
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 speak only of features in the spirit of C; something like object-orientation, though a nice feature, does not belong in C. Something like being able to #define a #define would be very handy, though, e.g: #define DECLARE_FOO(bar) #define...
16
1711
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 way to do one thing with Java. Kinda of language I prefer is, elegant syntax, high-speed, wide usage, robust, great degree of freedom. I did learned C quite a long time ago, only a bit though. Not really sure is C the really language approriate?...
2
3146
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 procedures. It is enabled for SQL stored procedures. It is possible to "Build" and "Run" the Java SPs, it just isn't possible to click on the "Build for Debug" option. Thanks for any help in advance. Michael
458
21199
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 simply aren't smart enough to understand C++? This is not merely a whimsical hypothesis. Given my experience with Java programmers --- the code they write and the conversations they have --- Occam's Razor points to this explanation. For example,...
0
8674
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.