• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Book question: Making code pythonic

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony Briggs & Steve Holden,
In python there are many ways to do things. There can be ways that people coming from another programming language take because they are used to it and then a "pythonic" way - a way that some rich feature of the python language provides to make the same objective achievable in a very elegant way.

Does this book provide many python tips to make your code more pythonic?

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved this from the welcome thread

Chris Webster wrote:
Luke Murphy wrote:Hi,
In python there are many ways to do things. There can be ways that people coming from another programming language take because they are used to it and then a "pythonic" way - a way that some rich feature of the python language provides to make the same objective achievable in a very elegant way.

Does this book provide many tips to make your code pythonic?

Making Java code Pythonic - would that be like writing it in Groovy?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris,
Like Jython perhaps?

The question is good though. Does the book contain python idioms. I'd hope so!
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Chris,
Like Jython perhaps?...

Sure. If you're already coming from a Python background to the JVM then Jython would presumably be a good choice. But if you're already on the JVM with JEE and you want the benefits of some "pythonic" features (dynamic programming, closures etc), without a more radical shift such as Clojure, then Groovy seems like a better choice (to me at least) than Jython. Jython is a secondary JVM implementation of a language whose primary development is elsewhere, while Groovy (like Clojure etc) lives on the JVM in the first place.

But it's "Hello! Python" this week, so let's hope we can all pick up lots of Python goodness for whichever languages we use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic