[jawsscripts] Re: quick constants protocol question

  • From: "Homme, James" <james.homme@xxxxxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 15 Jul 2010 07:16:43 -0400

Hi Geoff,
For variables, I like to use a small letter s in front for a string, a small 
letter i for integer, and a small letter h for handle. For globals, I use a 
capital letter g followed by a capital letter s, i, or h. That helps JAWS say 
the g i, g s, or g h. Then, I capitalize the next letter. I use a small letter 
o for object. I think there's also a new variable type called varient, so I'd 
use a small letter v for that. When you code an array, you can tall that it's 
an array because of the punctuation on the line.
When I use constants, I don't worry about the data type as much as I try to 
think about its purpose. I might use ks for key stroke, wc for window class, 
msg for message, wt for window type, and so on.

Doing all of that makes it so that I don't have to look stuff up to know what 
it is.

Jim Homme,
Usability Services,
Phone: 412-544-1810. Skype: jim.homme
Internal recipients,  Read my accessibility blog. Discuss accessibility here. 
Accessibility Wiki: Breaking news and accessibility advice


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx 
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Geoff Chapman
Sent: Wednesday, July 14, 2010 4:55 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: quick constants protocol question

ah. well, thank you don.  I'm glad I'm not the only one then who feels this
way.  I guess If I got the script manager to not speak underlines, then I
could more readily tolerate all capitalized words for constants, so long as
I then separated each one by an underline. That isn't however, what I've
seen done much. what I've seen is either they'll put c then underline then a
mixed case nicely speaking word, or just an all caps bunch of words not
separated by anything!  which, as I say, connotes unintelligibility to
screenReaders.
And I guess I could safely assume the majority of anyone whose gunna be ever
digging into my code, will be a screenReader user, so ... yeah. maybe I'll
just abandon the sightling protocol on that one? and adopt the Mixed Case
global variable protocol instead, for constants also, but with the small c
at the front end of it.

I guess I could adopt the allCaps constants, and separate each one by an
underline, then turn off underline speaking in either the profile for Script
manager punctuation, or using script manager dictionary to do that, but,
hmmm, this could come back to bite me I guess, If I'm for example, needing
to process strings in script manager which contain underline characters eh.
that might not be such a good option. might just stick with my global
protocol thought adoption instead. I could just detail this at the top of my
jss file as like a, key, type thing I guess eh?


----- Original Message -----
From: "Donald Marang" <donald.marang@xxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Wednesday, July 14, 2010 12:39 AM
Subject: [jawsscripts] Re: quick constants protocol question


>I agree with you Jefgf.  That technique is clear to me.  Make sure whatever
> convention you follow that you are always consistent.  As you have found
> out, lack of consistency is very confusing!  I still try to follow all
> upper
> case with underlines for constants.  For the sighted, this clearly makes
> constants obvious.  For screen readers it just means unintelligible
> pronounciation of the constant.
>
> Don Marang
>
> --------------------------------------------------
> From: "Soronel Haetir" <soronel.haetir@xxxxxxxxx>
> Sent: Tuesday, July 13, 2010 8:44 AM
> To: <jawsscripts@xxxxxxxxxxxxx>
> Subject: [jawsscripts] Re: quick constants protocol question
>
>> All caps separated with underscore is inherited from C where that is a
>> fairly universal standard for most constant values.  Not using the
>> underscore in that situation is somewhat odd (though of course there
>> are places you will see it).
>>
>> So long as you are consistent you won't get a lot of complaints no
>> matter what you do.
>>
>>
>>
>> On 7/12/10, Geoff Chapman <gch@xxxxxxxxxxxxxxxx> wrote:
>>> mighty longTime Scripters.
>>> In my brief forays into this crazy scripting world, for which I'm
>>> feeling
>>> less and less fitted as the days go on, but that's another story,
>>> I've found that sometimes, constants are written like this:
>>> c_myFavoriteFunkyThing
>>>
>>> presumably the C, up front, indicating the thing is a constant.
>>> Yet other times, I've seen this other horrible standard going on, where
>>> people will write the whole thing in upperCase, which to my mind is
>>> simply
>>> horrid! so far as firstPass comprehension Jaws speech output is
>>> concerned,
>>> like this:
>>>
>>> MYFAVORITEFUNKYTHING
>>>
>>>
>>> which I PERSONALLY abhor.
>>>
>>> TO ADD TO MY DISCUSSION,
>>> I've seen globals written sometimes with an underline separating the
>>> small g
>>> from the rest of the global definition, BUT other times, quite happily
>>> just
>>> small G for global, small letter denoting global type, i.e. s for
>>> string,
>>> i
>>> for integer etc, then a mixed case Delineated global name. like this:
>>>
>>> giTrunkAndTransfer
>>>
>>> which I like infinitely better!
>>>
>>> So, what I wanna know is, how horrifically renegade of me would it be,
>>> if
>>> I
>>> didn't want to follow either of these seemingly standard constant
>>> definition
>>> protocols, and do them more like global ones? such that we avoid Jaws
>>> having
>>> to waste precious time saying "underline,", but we still hear the c for
>>> constant, separately spoken before the mixed case Constant def? like
>>> this:
>>>
>>> cMyFavoriteFunkyThing
>>>
>>> how unacceptable would such an adoption be for me to make? and, why oh
>>> why,
>>> didn't everyone just adopt this one in the first place? since it's how
>>> globals seem to be quite happily defined? so there was already a good
>>> precedent there?
>>>
>>> I simply do dislike trying to work out what constants are, when they're
>>> all
>>> written in uppercase, and surely other speech users must've chafed under
>>> this restriction as well?
>>>
>>> thanks for any thoughts.
>>>
>>> oh, please do be gentle in your remonstrances if any are due me for
>>> these
>>> thoughts/desires eh.
>>>
>>>
>>> geoff c.
>>>
>>>
>>>
>>> __________�
>>>
>>> View the list's information and change your settings at
>>> http://www.freelists.org/list/jawsscripts
>>>
>>>
>>
>>
>> --
>> Soronel Haetir
>> soronel.haetir@xxxxxxxxx
>> __________�
>>
>> View the list's information and change your settings at
>> http://www.freelists.org/list/jawsscripts
>>
> __________�
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>

__________�

View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts


This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed.  If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it.  If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
 The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.
__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: