pep 8 constants

Eric S. Johansson esj at harvee.org
Mon Jun 29 22:37:15 EDT 2009


Steven D'Aprano wrote:

> Why do you think a smart editing environment is in opposition to coding 
> conventions? Surely an editor smart enough to know a variable name spoken 
> as "pear tree" is an instance and therefore spelled as pear_tree (to use 
> your own example) would be smart enough to know a variable name spoken as 
> "red" is a constant and therefore spelled "RED"?

no. I think a smart editing environment should support a coding convention. If
an editor is smart enough to track type and instance information, yes. It should
be able to generate the right strings for symbols. The question is, how do we
get such a smart editor.  as far as I know, none exist and the smart ones so far
seem to be oriented towards hand use and are almost inaccessible to speech.
> 
> Sounds to me that your speech environment needs a command to turn 
> capslock on and off, and your problem with PEP 8 is solved:

you haven't used recognition, have you?
> 
> x equals caps on red caps off plus three

it also means "red" is a single utterance. "RED" is three utterances. You've
just tripled vocal load for single word which means vat you just cut my ability
to work by two thirds. My voice is not as robust as my hands used to be. It's a
coarse tools not designed for engraving fine detail but instead painting
broadbrush strokes. for more you expect a person to say, the less time they can
spend on work effort. This is why I'm advocating a very smart at her with very
high level grammar structure using visual disambiguation techniques.

>> Heck, have you ever noticed how most Python smart editors can't even
>> indent properly according to local contexts. Emacs is the only one and
>> even that one sometimes fails
> 
> I use kwrite for editing, and I can't say I've ever noticed a failure.

okay, it fails from a speech recognition user perspective. Put the cursor on the
line and hit the tab key. Insert spaces/tabs in the line of text. Not good for
speech recognition. If  mess of indentation and hit the tab key, it doesn't
automatically indent to the right location. I'll be damned if I'm in the sit
there speaking "tabkeytabkeytabkeytabkeytabkey" because the error should take
care of it for me and save my voice. Like I said, Emacs does it correctly and
nobody else does as far as I can tell.

>> I've lived this works and probably have put more deep thought and 8kloc
>> into it because I do not accept circures tricks as a way of life.  I
>> want it to work right and I know how to do it.  I just don't have the
>> hands and hte money to pay me to do it.
> 
> You're using a speech interface, right? You've written about "putting a 
> gun to your wrists", said you can't follow PEP 8 because it's not voice 
> safe, and generally given the impression that you can't use a keyboard.
> 
> So... just how do you get "hte" from saying "the"?

joys of speech recognition.  it was probably either due to a persistent
misrecognition that didn't have the right word and the correction dialog or, I
found the speech recognition error and could not corrected by voice.

and note, there are two errors above that lie would have had to correct by hand.

> If you are using a keyboard to type this post, then surely it's not such 
> a huge imposition to type a couple of words in all caps here and there 
> while you speak the rest of the code?

 if I had typed this post, there would be two orders of magnitude more errors
because of intentional tremors and reduction of targeting accuracy. to give you
Monday an example. Sometimes my hands shake so badly, I cannot eat soup or even
Chile.  I'm unable to use an iPhone except with a great deal of effort.  am the
iPhone with a user with tremors, you activate more than one key about a third of
the time.

> <speak> x equals </speak> <type> <caplock> R E D </type> <speak> plus 
> three </speak>

I only have about 1000 keystrokes equivalents today in my hands. Where am I
going to use them? Try adding (driving), preparing food, personal hygiene, or
typing PEP-8 compliant code?  What I usually do is I do something like
constant_read = RED at the beginning of my code and well I think you know I'm
getting at. I generate something only I can read which does nobody any good.

> I know that doesn't resolve the issue for those people who truly can't 
> use a keyboard at all, even for a single character, but it's unfair to 
> insist that the only permitted coding conventions are the ones suitable 
> for the tiny minority who, frankly, are going to have problems no matter 
> what coding conventions we have.

You're looking at it from the classical anti-accommodation perspective. Don't
change the convention, give us the tools so we can comply with what the rest of
you do. It's like instead of putting a cut out every street corner, every
powered scooter/wheelchair comes with a antigravity boost that will lift them
over the curbstone. Accessibility belongs with the individual through tools that
take the standard and change it to their needs. While we don't have
anti-gravitational devices, we can make smart matters and that would solve a lot
more problems than just the simple compliance with PEP-8
> 
> Especially when these coding conventions are entirely optional.

these conventions are religion for some special if you want to contribute code.
But look at the bigger issue. If your brother, or best friend was disabled and
couldn't make a living programming anymore, which you or which are not feel
enough compassion/responsibility to try and help them get back on their feet?
Assuming your answer was a compassionate one, try and extend that out word to
tens of thousands of developers losing their  livelihood every year. Do you feel
enough compassion and can you get together enough people feel similar levels of
compassion to try and build a smart editing environment (all dicksizing about
gui kits aside) and make it possible for these people to continue in their
desired profession?

I know I hit on this point a lot but not are you helping your peers, some people
you may even know but you are saving yourself from being forced away from
programming at some point in the future whether it be from RSI, arthritis,
broken wrist, drop the fee or whatever. As we age, we all lose ability. I wish I
had known enough about the future to try and secure a future for myself but I
didn't. And so now I play an absolute pain in the ass on the net trying to get
people to think about themselves and their fellow programmers. I know I'm
obnoxious, I'm sorry but I want something to work for more than just me. I want
something that can be  reproduce by individuals, rehabilitation facilities,
handicap advocacy groups. I don't want anyone to go through what I did trying to
rebuild my worklife. It was hell and if I can save somebody from it by being an
advocate, I'm going to keep doing it

So yeah, it would be swell to have a smart editor. I do believe that with the
right groundwork, a smart editor could not only serve the needs of people with
speech recognition but also present enough information so that text-to-speech
users can hear what they're working with. He may not be able to imagine this
but, you don't want to read the display, you want to read the meta-information
behind the symbols on the display and that's what a blind programmer would need
to hear in order to understand the code. Or at least that's what  a few have
told me.



More information about the Python-list mailing list