Ruby parens-free function calls [was Re: Accessing parent objects]

Python python at bladeshadow.org
Mon Mar 26 19:10:04 EDT 2018


On Mon, Mar 26, 2018 at 02:19:12PM -0700, Rick Johnson wrote:
> On Monday, March 26, 2018 at 3:09:38 PM UTC-5, Python wrote:
> > On Mon, Mar 26, 2018 at 11:37:35AM -0700, Rick Johnson wrote:
> [...]
> > > Ruby followed the rules.
> > > But you didn't.
> >
> > Nonsense... Your language's syntax parser is what defines
> > the rules. All of the expressions Stephen wrote did not
> > yeild a syntax error, therefore he "followed the rules."
> 
> Hmm. If "syntax parser rules" could prevent poorly formatted
> code, then there'd be no need for style guides.

It may be telling that my team has minimal style standards for C/C++,
and none at all for Python... [We don't feel it requires any.]

> > > No self-respecting professional programmer would ever
> > > write in such a manner.

I should also have said that I think this assumes a certain level of
expertise with the language.  We all start out as novices with every
new language, and may spend a very long time there, depending on how
much we use it...  So, basically, I'm saying that's false. :)

> > I think your expectation here is much too high.  I've seen
> > A LOT of Perl written by, for example, professional
> > testers, of this ilk, and I've seen it cause bugs when a)
> > they got the syntax very slightly wrong, or b) they got the
> > syntax right but someone else to whom the intention wasn't
> > clear "fixed" it.
> 
> Perl is a special case (and thus not a good retort) because
> the language itself was purposely intended to be cryptic.

I think Larry would disagree with that assessment...

> Thus, what Perl programmers consider to be "normal and
> perfectly acceptable code" would cause the rest of us to run
> away in horror.

Regardless of what Larry says, I agree with that assessment.  Perl has
been relegated to "only use when there is no option" in my regieme,
which basically means only when it is absolutely necessary to maintain
some legacy garbage that's already Perl.

> > Humans are already good enough at making mistakes that they
> > require no additional encouragement, such as what is
> > provided by allowing such syntactical horrors.
> 
> Agreed. And that's why we must respect and follow the code
> styling wisdom which has been passed down by those who
> struggled before us. Sure, the behavior that Steven
> uncovered is odd, but it could be that Maz harbors a strong
> disliking for undisciplined pupils
[...]
> IOWs: It's not a bug, dude, it's a feature.

I dunno, this smells a lot like BS.

Ruby touts itself as being a simple language with elegant syntax.
This thread is my only exposure to it to date, but what I've seen here
is, frankly, the exact opposite of that.  You should not need a map to
distinguish function calls from variables, or operands from function
arguments, let alone have the latter depend on the position of the
operator token relative to any whitespace between it and the two
tokens on either side of it.  That's hard to read, complicated,
inelegant, and just poor syntax. [My opinion, obviously.] That's not
enough exposure to decide that the language isn't simple and elegant
overall, but it certainly does induce a strong negative prejudice.




More information about the Python-list mailing list