Syntax police?

In a small script someone wrote at work I saw the indirect pattern of new Object, instead of the more correct form of Object->new. When I inquired (okay, I said "WTF?!"), he said that he just copied the synopsis of a module. Oh, right.. some of the synopses (plural of "synopsis", bet you didn't know that!) still have some outdated syntax examples.

I'm not gonna write about how we should all update our PODs to remove syntax that hasn't been (or shouldn't have been, at least) written for the last 10 years, even though I should! I wrote to talk about the reply my co-worker got when he opened a ticket asking for the synopsis to be updated, per my suggestion.

He got the reply "what is this, the syntax police?" Perhaps half-jokingly, but still problematic, IMHO.

Police? No. Neighbors, family members and friends? Yes!

I wouldn't trust the police as far as I can throw a piano, and I don't even have a piano, so you can bet your ass I can't throw one very far! However, I do trust my friends and family (and maybe even my neighbors) to help me in a time of need, to advise me, to assist me, to care about me getting a better result. (Also, if you're in Texas, it's more likely that your neighbor will have much more firearm than your local police department)

How have some people become so bitter towards their community members when suggesting a correction? I'm not asking you for a kidney, I'm asking you to correct an example that presents code people shouldn't write anyway. You don't want to update the POD? Fine, but why would you be abusive towards someone who just wants to improve Perl? To make it a more understandable, correct language?

Since when are ambiguous syntax correction suggestions taboo? Soon I'll advise someone to use lexical variables and I'll get my head bitten off.

Sure, I'm a bit overreacting. I still think how we treat each other is important, and this is one way we can improve.

9 Comments

You can pry my legacy synopsis away from my cold, dead kidney.

Did you include a patch? That can go a long way towards giving the giving the impression that you're invested in the process and trying to be helpful. The author may have assumed you just wandered across their synopsis page and had nothing better to do than pick on his syntax, who knows?

Maybe your request was extremely polite, helpful, self-effacing, whatever, I don't know. But your post here is all about the maintainer's reaction to the substance of your request, yet you say nothing about whether they might be reacting to how you framed it.

I find that it's common among techies to treat matters like politeness, tone, and other contextual factors as being "beside the point", but unfortunately that's just not how our monkey-brains are wired. :)

If you really wanted to remove all ambiguity then you should have suggested Object::->new. ☺

Writing Object->new will be parsed as Object()->new if an Object function has been declared by the time this code is compiled.

I've submitted patches to multiple projects to update their POD to eliminate indirect object notation. The patches have always been well received.

There is a reasonable chance that the module author would accept the patch, even if they haven't gotten around to making the change themselves.

If you have a doubt that they'll "get" the value of the change, Chromatic has a nice post on the topic you can link to for reference:

http://www.modernperlbooks.com/mt/2009/08/the-problems-with-indirect-object-notation.html

Then again, that ambiguity is *good* ambiguity if you like the idea of aliased.pm :)

I agree that the submitter deserved a polite response. The attitude that "you aren't paying me for this code, so I can be a jerk to you" is one of the things I enjoy the least about Free Software.

Still, I'm not very enthusiastic to apply coding style patches to things I maintain, much less to their documentation. I know Perl programmers are obsessed with style -- "TIMTOWTDI, so let's argue about them!" -- but it just seems like there are much better uses for people's time, like, say, finding and fixing actual bugs and adding features.

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz