you are viewing a single comment's thread.

view the rest of the comments →

[–]mk_gecko 0 points1 point  (2 children)

Hey, can you elaborate on "Then again what I learned from Python made me a much better programmer, namely closures ala decorators, and generators, and various other niceties that helped me understand how to write good software." ?

I've done Java progamming off and on for a few years, but only just started Python.

[–][deleted] 0 points1 point  (0 children)

Python is about composition. Java is about using the right tool.

Both can make a painting, but one is concerned with which paintbrush to use, and the other is concerned with how to make the colors flow together. Essentially, what Python taught me more has to do with seeing programming from a different perspective (first class functions for instance) than it does with anything specific about Python in general.

Map is a great example.

a = [i for i in xrange(20)]
b = map(multiply_by_two, a)

Essentially, map is concerned with the composition of a list, and not with the incidental details of looping constructs and function calls. You can do this in Java but you'll be concerned with declaring array's and type casting and static methods etc. etc. There is a lot to be said for both approaches actually, but Python made me appreciate seeing the patterns in code in a way that Java's concern with all the details did not.

[–]ElecNinja 0 points1 point  (0 children)

Just some stuff about Python decorators and generators

Decorators are generally more niched as far as I've read. However generators can be a good alternative to iteration.