Question mark in variable and function names

S

Sion Arrowsmith

Dan Christensen said:
If python only allowed ! and ? at the end of identifiers, then !uname
would be fine, and ?x could be used in place of x?

It seems to me that allowing them in the same places in an
identifier as a digit would lead to the least proliferation
of different cases (and be easier on the lexer).
But the problem mentioned in other post with code like x!=0 is more
serious.

Knew there was a good reason for using <> instead of != (-6
 
V

Ville Vainio

Cliff> *smacks forehead and cries*

Why? Ergonomics is a matter that is taken into account way too rarely,
just observe how frequently programmers complain about RSI these
days. Python is pretty ergonomic for the most part (not too much
punctuation, popular habit of preferring lowercase letters) but it's
often a good idea to go for a little extra edge :).
 
C

Cliff Wells

Cliff> *smacks forehead and cries*

Why? Ergonomics is a matter that is taken into account way too rarely,
just observe how frequently programmers complain about RSI these
days. Python is pretty ergonomic for the most part (not too much
punctuation, popular habit of preferring lowercase letters) but it's
often a good idea to go for a little extra edge :).

I'm crying because I've been hitting shift 8000 times a day for 20 years
when such a simple solution was right in front of my face :p
 
C

Carlos Ribeiro

I'm crying because I've been hitting shift 8000 times a day for 20 years
when such a simple solution was right in front of my face :p

Totally off topic -- if you were to design a new keyboard, where do
you would put the parenthesis? After reading that I was wondering
about what is the best choice:

1) put each parenthesis on one side of the keyboard (open in the left
hand, close in the right hand);

2) keep both parenthesis on the right side of the keyboard, where
there are a few spare keys, _including_ the ones for square brackets
and regular brackets (I have a brazilian ABNT-2 keyboard);

3) design a new block of keys, similar to the (Insert/Delete,
Home/End, PgUp/PgDn) block, with quick punctuation symbols --
parenthesis, brackets, square brackets, angle brackets, slashes
(forward and back), hyphen+underline, and similar pairings. A vertical
block of keys, with two columns, five rows -- it's enough for most
pairings without a shift key.

_If_ I was to design my own keyboard, I would probably keep it Qwerty
(already used to it, and also, changing it makes difficult to use
anything else); but I would probably implement option (3) for
frequently used symbols.

--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)
 
C

Cliff Wells

3) design a new block of keys, similar to the (Insert/Delete,
Home/End, PgUp/PgDn) block, with quick punctuation symbols --
parenthesis, brackets, square brackets, angle brackets, slashes
(forward and back), hyphen+underline, and similar pairings. A vertical
block of keys, with two columns, five rows -- it's enough for most
pairings without a shift key.

_If_ I was to design my own keyboard, I would probably keep it Qwerty
(already used to it, and also, changing it makes difficult to use
anything else); but I would probably implement option (3) for
frequently used symbols.

That's not a bad idea. A screwdriver, a spare keyboard from which to
steal keys, and xmodmap would let you replace the numeric keypad with
the punctuation characters. You could still have your numbers, just
replace the cursor functions (numlock off) with the punctuation codes
(assuming the cursor codes on the numeric keypad differ from the codes
on the regular arrow keys? Have to check on that.).

Still, I think that since it requires that your hands leave the home row
that not much would be gained. I can shift+key faster than I can move
my right hand to the arrow keys or the numeric keypad.

A former coworker of mine had an interesting ergonomic keyboard that had
a foot pedal for accessing extra keys. This might be a superior
solution for many people (disabilities or chronic foot-tapping
notwithstanding).

Regards,
Cliff
 
J

Jeff Shannon

Carlos said:
I'm crying because I've been hitting shift 8000 times a day for 20 years
when such a simple solution was right in front of my face :p

Totally off topic -- if you were to design a new keyboard, where do
you would put the parenthesis? After reading that I was wondering
about what is the best choice:

1) put each parenthesis on one side of the keyboard (open in the left
hand, close in the right hand);

2) keep both parenthesis on the right side of the keyboard, where
there are a few spare keys, _including_ the ones for square brackets
and regular brackets (I have a brazilian ABNT-2 keyboard);

3) design a new block of keys, similar to the (Insert/Delete,
Home/End, PgUp/PgDn) block, with quick punctuation symbols [...]

The problem with this is that you're taking your hand too far away from
the center of the keyboard. You want something that you can reach
easily, without significant stretching and without needing to watch
carefully when you return your hand to the home row. I'd personally be
inclined towards option 2.

Heck, that would really only require a slight remapping on my current
keyboard, at least to get parens accessible without shifting --
currently [/{ and ]/} are just to the right of P; I can see an advantage
to remapping those keys to be (/[ and )/], and putting { and } above 9
and 0 where the parens are now...

Of course, for me it's not worth customizing my keymapping, because I
end up working on a variety of machines often enough (frequently in the
sense of "fixing", rather than just trying to get my own work done).
Switching back and forth from a custom keymap to the standard one would
be confusing enough to counteract any gains I'd make from a more
ergonomic arrangement of keys. (Now, if I could convince everyone
worldwide to switch to (nationalized keyboards based off of) a
Dvorak-style arrangement, that'd be a different matter.... :) )

Jeff Shannon
Technician/Programmer
Credit International
 
D

Diez B. Roggisch

The problem with this is that you're taking your hand too far away from
the center of the keyboard. You want something that you can reach
easily, without significant stretching and without needing to watch
carefully when you return your hand to the home row. I'd personally be
inclined towards option 2.

Heck, that would really only require a slight remapping on my current
keyboard, at least to get parens accessible without shifting --
currently [/{ and ]/} are just to the right of P; I can see an advantage
to remapping those keys to be (/[ and )/], and putting { and } above 9
and 0 where the parens are now...

Of course, for me it's not worth customizing my keymapping, because I
end up working on a variety of machines often enough (frequently in the
sense of "fixing", rather than just trying to get my own work done).
Switching back and forth from a custom keymap to the standard one would
be confusing enough to counteract any gains I'd make from a more
ergonomic arrangement of keys. (Now, if I could convince everyone
worldwide to switch to (nationalized keyboards based off of) a
Dvorak-style arrangement, that'd be a different matter.... :) )


I use the FingeWorks Touchstream Keyboard, dvorak layout - its USB and very
portable. And it has the exact feature you're talking about: The keyboard
is divided in two parts. When placing the left hand in a specail way, the
right becomes the "programmers pad" - which allows access to all common
syntactic symbols, and even has some special keys that produce ->, !=, //
with only one keystroke. Checkout the website: www.fingerworks.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top