[BangPypers] Object Oriented Programming in python

Saager Mhatre saager.mhatre at gmail.com
Mon Oct 21 07:45:53 CEST 2013


On Oct 21, 2013 1:18 AM, "s|s" <supr.e.etsethi at gmail.com> wrote:
>
> Lets look at integer as an example in Python (int)
>
> class int(object)
>    int(x[, base]) -> integer
>
> which is unlike java where int is a "basic" non-class type. An explicit
upgrade to **Integer** class is required to use OOP features. This is done
with sole purpose of machine efficiency.
>

Seriously, we're arguing primitive types here?!? I mean, I'll admit they're
a blemish, but (as Dhananjay mentioned) they're hardly there to improve
bytecode generation. They were put in to appease the (memory) bean counters
so that they could control the heap sizes of objects, at least in their
heads. That said, the Tiger release introduced autoboxing, which dealt with
this. The JVMs runtime performance magic lies elsewhere entirely. I'm
banging this mail out on a tablet over GPRS, otherwise I would've hunted
down a few references for you.

Honestly, I urge you to look at other OO languages like SmallTalk (where it
sort of all began), Ruby & Groovy, or even JavaScript for that matter. Just
like we don't want to be narrow about what comprises OO, we should also not
restrict our examples/experience of OO implementations to C++ & Java (aside
from Python*).

- d

* The OO implementation in which I find somewhat questionable, but I
digress... :)


More information about the BangPypers mailing list