Home » Technology » Why Python is better than Java for Object-Oriented Design

The best way to stay in touch with PuneTech and associated activities is to subscribe and receive most recent updates in your email inbox or via RSS. And, if you are looking for special interest groups, Click here. See our About Page to find out more about what PuneTech is.

Like to chat with PuneTech's founder? Connect now!

Why Python is better than Java for Object-Oriented Design

Dhananjay Nene recently switched over to Python and has discovered that he is much happier writing programs in Python. We covered his first article in the series, and the end of that post gives an idea of why we think you should listen to him, and also subscribe to his blog. In the next article in the Python vs. Java series, he takes a few design principles of object-oriented programming and shows how to implement those using sample code in Java and Python. 

An excerpt to whet your appetite:

Well, static typed languages use polymorphism as a powerful mechanism of extensibility. In other words, in many cases the extensions are likely to be newer derived types. Thus design the rest of your code to work on the base type and introduce the newer derived types later as required without having to necessarily change existing code. However static languages primarily depend upon inheritance as the vehicle for delivering polymorphism. Dynamic languages on the other hand depend upon duck typing. Duck typing supports polymorphism without using inheritance. In this context you need the same set of relevant methods to be implemented in each of the extension classes. The role of the abstract base class or interface as the one which specifies the contract / api has been made redundant. You can still choose to define a base class / interface if you want to, but you no longer have to. 

The full article is a must read if you are a student of programming languages in general, and object-oriented programming in particular. If you are neither of those things, and if you plan to be in the software field for a while, then you seriously need to ask yourself, ”Why not!?“.

If you liked this post, subscribe for updates by email or via RSS.

Comments

One response to Why Python is better than Java for Object-Oriented Design

  1. Sujit Nair says:

    Hi,

    I am A student of M.C.A. last year, and i felt that java is the best language madebut after seeing .NET then I thought the coding part has got simpler in .NET, as in the jobs for Java Freshers have lessened so ,i think i will opt for a project in .Net ,even though i like java the most. Now u said about another language called PYTHON , is there any need in companys? I do not know much about it .

Leave a Reply
Your email address will not be published. All fields marked * are mandatory.


Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.