471,321 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Python for Java programmer

Yo Group,

I'm excited to learn Python as new language coming year, I consider
myself good Java developer and, not so unusually, with very limited
experience with dynamic programming languages such as Python or Ruby.

I have started with basics at http://docs.python.org, but I'm more
interested in learning philosophies in programming dynamically typed
languages, I really want to get rid of those Enterprisely weird Java
techniques.

I'm looking for good resources and a better technique to learn Python,
would appreciate book references or URLs for them (Google explodes me
with info. and I don't really have time to read all that). Also, I'm
looking forward to hack some framework or library written in Python to
get a good deal of exposure to language and class library, So it would
be great if anyone would suggest such framework as well.

Looking forward for suggestions Python community!

Thanks,
Nirav Thaker
http://blog.nirav.name
Dec 14 '07 #1
5 1439
On Dec 14, 11:53 am, Nirav Thaker <nirav.tha...@gmail.comwrote:
Yo Group,

I'm excited to learn Python as new language coming year, I consider
myself good Java developer and, not so unusually, with very limited
experience with dynamic programming languages such as Python or Ruby.

I have started with basics athttp://docs.python.org, but I'm more
interested in learning philosophies in programming dynamically typed
languages, I really want to get rid of those Enterprisely weird Java
techniques.

I'm looking for good resources and a better technique to learn Python,
would appreciate book references or URLs for them (Google explodes me
with info. and I don't really have time to read all that). Also, I'm
looking forward to hack some framework or library written in Python to
get a good deal of exposure to language and class library, So it would
be great if anyone would suggest such framework as well.

Looking forward for suggestions Python community!
You may want to check out these first:

http://dirtsimple.org/2004/12/python-is-not-java.html
http://www.razorvine.net/python/PythonComparedToJava

George
Dec 14 '07 #2
Nirav Thaker a écrit :
Yo Group,

I'm excited to learn Python as new language coming year, I consider
myself good Java developer and, not so unusually, with very limited
experience with dynamic programming languages such as Python or Ruby.
Then you'll probably have to unlearn a few things...
I have started with basics at http://docs.python.org, but I'm more
interested in learning philosophies in programming dynamically typed
languages, I really want to get rid of those Enterprisely weird Java
techniques.
Fine !-)

A good start is of course the now famous "Python is not Java" article:
http://dirtsimple.org/2004/12/python-is-not-java.html

Also FWIW, the dynamic part is not restricted to typing. You can
dynamically modify class or instance attribute set (including methods),
hook into lookup rules or class creation, dynamically create functions,
classes or modules, etc... Syntax errors set aside, everything happens
at run time.
I'm looking for good resources and a better technique to learn Python,
would appreciate book references or URLs for them (Google explodes me
with info. and I don't really have time to read all that).
Having a decent knowledge of Python's object model (with special
attention to the lookup rules - and how you can hook into -, the
operators overloading and other __magic__ methods, and of course
metaclasses) may help - since everything in Python is an object
(including modules, classes, functions etc). Once you understand what's
a Python object and how it works, you have a chance to start thinking
otherwise about how to structure your programs. Most of the relevant doc
is here:

http://docs.python.org/ref/objects.html
http://docs.python.org/ref/node33.html
http://python.org/doc/newstyle/
http://docs.python.org/ref/specialnames.html

Sadly, there isn't AFAIK any in-depth material exposing these features
and how they can used in real-world. But anyway:
Also, I'm
looking forward to hack some framework or library written in Python to
get a good deal of exposure to language and class library,
Note that the Python libraries (standard and thir-part) are not
necessarily that much class-oriented. With dynamic typing, you don't
need deep class hierarchies. And with everything being an object, you
end up thinking more in term of objects than in terms of classes.
So it would
be great if anyone would suggest such framework as well.
Here are a couple packages I learned (and I'm still learning) from:

- SqlAlchemy : a hi-level interface to RDBMS, including (but not
restricted to) an ORM layer,
- Elixir: a declarative layer on top of sqlAlchmy's ORM features,
- FormEncode : a conversion/validation lib, mostly used for the web but
usable for any outer-world/your-program data exchange. The "declarative"
API it's built upon is really worth reading if you want to see Python's
power in action, but beware, there are really things in it one should
not show to childrens !-)

HTH. And welcome onboard.
Dec 14 '07 #3
Welcome to Python!

One way to get you up to speed fast (and fun) is take some java app
you've written and implement it in Jython. After you've done that, and
gotten over the pleasant surprise of how short and clean your code has
become, go over the source again and see where you can replace calls
to java libs with calls to Python libs. E.g. for xml & xpath use
ElementTree instead of JDom, for timing use Python's timeit module,
etcetera. Although I've been using Python for a while now I've done
the same thing recently and was surprised by how clearly that exercise
showed Python's strengths.

Just go ahead and start programming is the best way to learn about the
philosophies behind a language.

2B
Dec 14 '07 #4
Having a decent knowledge of Python's object model

As explained clearly here:

http://www.cafepy.com/article/python...d_objects.html
http://www.cafepy.com/article/python...d_methods.html

2B
Dec 14 '07 #5
Berco Beute a écrit :
>>Having a decent knowledge of Python's object model


As explained clearly here:

http://www.cafepy.com/article/python...d_objects.html
http://www.cafepy.com/article/python...d_methods.html
I'm not sure these articles will bring that much to the OP.

Dec 14 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Paul Prescod | last post: by
176 posts views Thread by Thomas Reichelt | last post: by
114 posts views Thread by Maurice LING | last post: by
68 posts views Thread by Lad | last post: by
2 posts views Thread by Hal Vaughan | last post: by
25 posts views Thread by abhinav | last post: by
17 posts views Thread by MilkmanDan | last post: by
112 posts views Thread by mystilleef | last post: by
40 posts views Thread by walterbyrd | last post: by
270 posts views Thread by Jordan | last post: by
reply views Thread by rosydwin | last post: by

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.