[Baypiggies] Frequently Argued Objections
warren at muse.com
Sun Jun 22 19:25:03 CEST 2008
On Jun 21, 2008, at 7:13 PM, Shannon -jj Behrens wrote:
> On Sat, Jun 21, 2008 at 11:18 AM, Warren Stringer <warren at muse.com>
>> Yee HAW! Here, have some beef jerky while I explain why us cowboy
>> programmers are annoyed: Self has to be explicitly used yet is
>> passed as a parameter. Second, when counting keywords in the
>> standard python
>> library, "self" is the most common keyword, beating the 2nd most
>> keyword by almost a factor of two. I mentioned this to JJ, who says
>> that he
>> uses self and non-self in the same code base. I would love to see
>> an example
>> where this is useful, where the NRO wouldn't suffice. As a mere
>> Pythonista, all I see "self" doing is obfuscating the wide open
>> white spaces
>> that I have grown to love.
> Are you sure it was me? Are you referring to calling self by another
> name? I might have said it's possible, but I don't remember ever
> doing it.
Well, unfortunately, there is no google desktop style search for real-
life (at least yet). If there was, I would put in the keywords "apps
engine conference brown shirt jj" to call up our conversation around
a circular table at a recent google event in San Francisco. I
mentioned the self part, but may have left out the keyword count. This
wasn't about calling self by some other name. To be honest, I wasn't
sure of your reply. I thought that perhaps it had to do with class
*Is* there a reason to NOT use self? If not, then self is redundant.
If the reason to use self is to bypass name resolution order, then I
would suggest making the less common case explicit and the more common
Since we're taIking about Objections, I find the statement "explicit
is good", without a justification, to be Objectionable. The only
truly explicit computer language is a circuit diagram. Even assembly
language is implicit; anything with op codes is a transformation of an
explicit routing of electrical charges to an implicit pattern that
acts on an operand. Higher level languages build upon lower level ones
by transforming explicit combinations into an implicit pattern.
IMO, languages evolve by compressing complexity. Just as Morse Code
compressed symbols tapped by hand over a wire, where the most common
symbol "E" required a single tap. Python reduces complexity by
removing the redundancy created by the often unnecessary enforcement
of policy with typed variables and by removing the redundancy of using
begin/end symbols (for the compiler) along with whitespace (for the
human coders), when simply using whitespace would suffice. As a
result, Python is a more concise by making coding policy implicit.
However, Python is less concise when it enforces a policy about making
name resolution order explicit. From a statistical viewpoint, this is
akin to a Morse Code that assigning a single tap, not to the letter
'E', where it belongs, but to the letter 'Z'.
While some people may see "self" as an issue of faith, others see it
as a statistical anomaly (in an otherwise compact language).
More information about the Baypiggies