Looking for resources for making the jump from Java to Python easier and more productive

Harry George harry.g.george at boeing.com
Mon Apr 24 06:08:14 EDT 2006


Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> writes:

> In article <1145691651.385835.298600 at u72g2000cwu.googlegroups.com>,
>  "ToddLMorgan" <ToddLMorgan at gmail.com> wrote:
> 
> >Are there python specific equivalents to the common Patterns,
> >Anti-Patterns and Refactoring books that are so prevalent as
> >reccomended reading in C++ and Java?
> 
> I don't think they exist. Such books are targeted more towards 
> development in a corporate environment, where every proposal has to go 
> through multiple layers of management, and nothing is ever done by 
> individuals working alone, always by "teams" working on separate parts 
> of the project. And also where the end-users don't really get much say 
> in how things are supposed to work. It's only in such a high-overhead, 
> top-down, cover-your-ass environment that such books are looked on as 
> being at all useful. Possibly on the grounds that nobody ever got fired 
> for buying them.
> 
> I'd say languages like Python and Perl are the absolute antithesis of 
> this sort of development culture.

On "antithesis" comment:

Python can be used for Agile Programming, with the end user there at
the monitor.  But it can also be used for heavy duty development
regimens with data models, specifications, development teams working
multiple shifts or working worldwide, separate test-and-release teams,
etc.

On response to the OP:

The most important thing you bring to the table is knowledge of data
formats, algorithms, OO programming, and test-driven design. E.g.,
XML, HTML, LDAP, SQL, pipes, stacks, queues, threads, dictionaries,
lexers, parsers, regular expressions, matrix transformations, GUI
dialogs, etc.  Many of us consider Python a secret weapon in learning
new paradigms and technologies

The most important things you need to leave behind:

1.  Intuition about what is already available vs what you have to
write.  Java tries to reinvent the whole compsci world.  Python just
says "Nice C/C++/FORTRAN library; I think I'll use it via a binding."
If it is codable, it is probably scriptable in Python.

2. Temptation to reinvent entire stacks of libraries to replicate the
Java module import structure.  This is a real problem in migrating
existing code.  You have to take deep breath and ask "What is the
fundamental task, and how would a programmer do that in Python?"
Entire library trees melt away when you do this.

3. Fear you are missing something when you get done.  Python takes
c. 1/3 as many LOC as Java for the same task. At first I kept saying:
"This wee bit of code couldn't posssibly do the whole job, could it?"
If you have a good regression test suite, you are done when it works.
If you need help getting on board unittests, see mkpythonproj:
http://www.seanet.com/~hgg9140/comp/index.html#L006


-- 
Harry George
PLM Engineering Architecture



More information about the Python-list mailing list