Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Book question: Making code pythonic

 
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?

 
author & internet detective
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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
Posts: 40035
809
Eclipse IDE VI Editor Java
  • 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!
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • 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.
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic