logoalt Hacker News

driggs • today at 7:24 AM • 2 replies • view on HN

You've missed the joke, or maybe you weren't old enough to be learning Python during Java's heyday.

The joke is that people wanting to write Python like Java - with an implicit reference to an object's instance - would attempt to import Java's `this` keyword.

Instead of getting Java-like behavior, they're presented with the Zen of Python. You wouldn't be wrong to think that it was as much a commentary on other popular languages of the day as it was a guiding ethos of Python itself.

"Beautiful is better than ugly. Explicit is better than implicit."


Replies

js2 • today at 1:17 PM

Well that's embarrassing. I learned Java in 1996 in college. I was introduced to Python (1.5.2) at a startup in 2000. The startup was probably equally split between Java and Python code. I know the "this" module didn't exist till around 2004, but somehow in all these years I never made the connection and did indeed miss the joke. (But, as far as I can remember, I never accidentally attempted to import this in Python, and wasn't aware newbies did that.)

(Aside, I've essentially used Python almost exclusively since I picked it up. It's served me well in my career. I never have cared for Java.)

Anywho... thank you for explaining the joke that's now old enough to drink, but has eluded me all this time. :-)

wk_end • today at 8:00 AM

c.f. what happens when you try `from __future__ import braces`