Tom Ritchford
2 min readOct 19, 2019

--

On the contrary, it is possible to convert any Python program to be a single line program. Here’s a list of classic Python one-liners.

You might ask a few other questions, like “How desirable is a one-liner? Isn’t readability and reliability more important?” and “If I added PrimesUpTo in my language, it might create another one liner, but how often would I use it?”

Compare something simple:

$/ join: ($- split: ‘1969–07–20’) reverse

is in Python

'/'.join(reversed(‘1969–07–20’.split('-')))

which is to my eyes clearer too (what’s with $- as opposed to 1969-70-20? Two different sorts of strings?)

Python requires you to explicitly pass “self” as the first argument to all instance methods. This is unbelievably hokey.

If you indicated that you had some understanding of why Guido explicitly chose to do this, and you felt he had made the wrong decision, and presented an argument as to why, this would be an interesting comment.

Without any evidence of reasoning, it’s very very tempting to believe you simply didn’t like self the first time you saw it and gave it no thought at all thereafter.

It’s easily to find tons of explanations, and here’s Guido analyzing why this still can’t be bolted on to contemporary Python.

Might I ask — if I want to add a method to an existing object in Pharo, how can I do it?

Pharo is purely object-oriented from top to bottom.

Java started off that way. It annoyed people so much that eventually they had to put in e.g. free functions into the language.

Its clarity and consistency in this regard are unmatched by any other language.

Using magic so the pointer to the object is injected into the scope is not “clarity”!

While [PyCharm is] a nice IDE to be sure, there’s no question that it’s much, much larger and more complex than Pharo’s IDE.

I’m not even that familiar with PyCharm, but it has a huge list of useful features, features you’d miss if you needed and didn’t have.

I couldn’t find any documentation on what features the IDE part of Pharo has at all. The documentation page doesn’t seem to have some tutorial or walkthrough even.

You know, I might even like Pharo if the article wasn’t cast as “Your favorite language sucks, mine is better.”

--

--

No responses yet