Typing code

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

dasada122
Posts: 88
Joined: Sun Jun 14, 2009 8:41 pm UTC
Location: Wherever you aren't looking at the moment.

Typing code

Postby dasada122 » Wed Aug 12, 2009 5:55 pm UTC

When I type prose, I use the standard touch-typing method taught in schools. However, when coding, I find that my hands end up in the weirdest positions. For instance, my right hand will sometimes drift up a row for faster access to the parentheses (I do wish they had their own dedicated key!), while my pinky stays on the semicolon. Oh, and BRAINSTORM! Below the spacebar, they need to have some common keys like plus and minus or the bracket keys. It would be using the same muscle memory as phone input, and it always has annoyed me that not one, but TWO perfectly fine fingers are occupied by the operation of a single button.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Typing code

Postby You, sir, name? » Wed Aug 12, 2009 7:45 pm UTC

I use a sort of bastard touch-typing for both coding and otherwise. It's heavily influenced by the need to type a lot of of special characters, and also right-hand dominated. See diagram below. Red is resting positions, blue outlines the right hand's "domain". The hands approach the keyboard at an angle, and the resting position has most of the right hand fingers in a curl so that I can reach parentheses by simply extending the middle and ring finger.

800px-ModelM.jpg
800px-ModelM.jpg (49.63 KiB) Viewed 4102 times
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
scarecrovv
It's pronounced 'double u'
Posts: 674
Joined: Wed Jul 30, 2008 4:09 pm UTC
Location: California

Re: Typing code

Postby scarecrovv » Wed Aug 12, 2009 8:56 pm UTC

I use pretty standard touch typing methods for everything, with the minor exception that I've swapped the Caps Lock and Left Control keys. Some day I might experiment with reversing the symbols and numbers (so shift makes "9" and no shift makes "("). I agree about the extra keys below the space bar; that should be implemented sooner rather than later.

dasada122
Posts: 88
Joined: Sun Jun 14, 2009 8:41 pm UTC
Location: Wherever you aren't looking at the moment.

Re: Typing code

Postby dasada122 » Wed Aug 12, 2009 9:09 pm UTC

Oh! and you could use those OLED keys and make them soft.

User avatar
lu6cifer
Posts: 230
Joined: Fri Mar 20, 2009 4:03 am UTC
Location: That state with the all-important stone

Re: Typing code

Postby lu6cifer » Wed Aug 12, 2009 10:24 pm UTC

It actually depends on the text editor for me.

When I use something like Gedit or Notepad++, my hands will be in the home row
When I use emacs, my left hand moves about an inch to the left so my pinky has a stronger position on that ctrl key

But someone really should invent a programmer's keyboard that makes the parentheses, hashes, ampersands, etc...really easy to access; or, just mod one of those standalone numpads to include all of those keys.
lu6cifer wrote:"Derive" in place of "differentiate" is even worse.

doogly wrote:I'm partial to "throw some d's on that bitch."

User avatar
TheChewanater
Posts: 1279
Joined: Sat Aug 08, 2009 5:24 am UTC
Location: lol why am I still wearing a Santa suit?

Re: Typing code

Postby TheChewanater » Thu Aug 13, 2009 4:04 am UTC

I just type the normal school-taught orthodox way. The only thing that bugs me is that pressing the +, -, and = keys sometimes takes a second, assuming I get it the first try (my pinky is probably messed up from non-ergonomic keyboards), then another few to realize that I've been type with my right hand on the "QWERTYUIOP" (top letters) row, and my typing or coding looks like this

ty8sno99isno8iensy8tknd9esh[tn8t:

That would make a cool challenge. Decoding writing or code that had the right hand on the top row.
ImageImage
http://internetometer.com/give/4279
No one can agree how to count how many types of people there are. You could ask two people and get 10 different answers.

User avatar
jaap
Posts: 2094
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

Re: Typing code

Postby jaap » Thu Aug 13, 2009 6:18 am UTC

TheChewanater wrote:ty8sno99isno8iensy8tknd9esh[tn8t:
Yes, it does.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Typing code

Postby qbg » Thu Aug 13, 2009 4:45 pm UTC

Dvorak works quite well for me when typing code.

dasada122
Posts: 88
Joined: Sun Jun 14, 2009 8:41 pm UTC
Location: Wherever you aren't looking at the moment.

Re: Typing code

Postby dasada122 » Thu Aug 13, 2009 6:36 pm UTC

OK, here's a little prototype I worked up.
Image

Now, if I were to buy one of those USB numpads, how would I go about remapping the keys?

User avatar
Ran4
Posts: 131
Joined: Mon May 04, 2009 2:21 pm UTC

Re: Typing code

Postby Ran4 » Thu Aug 13, 2009 7:43 pm UTC

Oh, I haven't really thought about this before. I guess my finger style is great after all!
I never use my left pinky for anything else than left control/left shift, and I move my fingers slightly more than needed. E.g. I move the entire finger when writing something that isn't on home row. The good thing about that is that getting to the numbers row isn't very hard.

My right hand fingers are around KL;, , which means I can easily reach enter and slightly rotate my hand to reach end with my pinky without moving my hand. (The end key is probably my favorite and I use it constantly: almost as much as enter). My left hand is somewhere close to ASDF, I always keep my pinky on lshift or lctrl.

The only real problem I have is 7... It's impossible to reach! 6 can be reached with my left hand, 8 with my right, but I can't reach 7 without stretching my hand. On my keyboard, shift+7 is /, so division isn't exactly my favorite operator.

I'm thinking of rebinding three keys which I don't use right now: ÅÄÖ. Å is to the right of p, ÖÄ is together to the right of L. Hm, I guess I could make an autohotkey script for that... *opening up scite*
Spoiler:
edit: done! woho...

Code: Select all

#IfWinActive, ahk_class SciTEWindow
    ä::
        Send,{Home}class{Space}{end}(object):{Enter}{Tab}def __init__(self):{Enter}{Tab}pass+{Home}
    return
#IfWinActive


dasada122 wrote:OK, here's a little prototype I worked up.
Image

Now, if I were to buy one of those USB numpads, how would I go about remapping the keys?

Autohotkey would probably do it, thought that'd just be replacing what the num_# keys do (eg. you wouldn't be able to use your own keyboards numpads).
Last edited by Ran4 on Thu Aug 13, 2009 7:59 pm UTC, edited 1 time in total.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Typing code

Postby You, sir, name? » Thu Aug 13, 2009 7:55 pm UTC

Ran4 wrote:My right hand fingers are around KL;, , which means I can easily reach enter and slightly rotate my hand to reach end with my pinky without moving my hand. (The end key is probably my favorite and I use it constantly: almost as much as enter). My left hand is somewhere close to ASDF, I always keep my pinky on lshift or lctrl.


Hah, seriously, look at my diagram above. We type in an almost identical fashion.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Ran4
Posts: 131
Joined: Mon May 04, 2009 2:21 pm UTC

Re: Typing code

Postby Ran4 » Thu Aug 13, 2009 8:05 pm UTC

You, sir, name? wrote:
Ran4 wrote:My right hand fingers are around KL;, , which means I can easily reach enter and slightly rotate my hand to reach end with my pinky without moving my hand. (The end key is probably my favorite and I use it constantly: almost as much as enter). My left hand is somewhere close to ASDF, I always keep my pinky on lshift or lctrl.


Hah, seriously, look at my diagram above. We type in an almost identical fashion.

Yup, thought I reach UHN with my right hand :)

dasada122
Posts: 88
Joined: Sun Jun 14, 2009 8:41 pm UTC
Location: Wherever you aren't looking at the moment.

Re: Typing code

Postby dasada122 » Thu Aug 13, 2009 8:19 pm UTC

I remember reading somewhere around here about an idea for a chorded keyboard program- it would remap all the right hand keys to their lefty counterparts when a meta-key was pressed, so one hand could be on the keyboard and one on the mouse. Does anybody know if this program was ever actually made? For Windows? (Sorry, I have to use Vista for school.) The idea seemed similar to this Frogpad thing, and it looks like a cool gadget, but does anyone here use one? I'd like a review before I dish out $150 for it.

User avatar
Ran4
Posts: 131
Joined: Mon May 04, 2009 2:21 pm UTC

Re: Typing code

Postby Ran4 » Thu Aug 13, 2009 8:53 pm UTC

dasada122 wrote:I remember reading somewhere around here about an idea for a chorded keyboard program- it would remap all the right hand keys to their lefty counterparts when a meta-key was pressed, so one hand could be on the keyboard and one on the mouse. Does anybody know if this program was ever actually made? For Windows? (Sorry, I have to use Vista for school.) The idea seemed similar to this Frogpad thing, and it looks like a cool gadget, but does anyone here use one? I'd like a review before I dish out $150 for it.

That could be done easily in autohotkey. If you just figure out some good layout, it would probably take < 30 minutes to implement and debug. You wouldn't even have to install anything, since you could compile it as an .exe ready for use with windows (eg. put it on an usb drive or something so you'll always have access to it).

User avatar
InkL0sed
Posts: 205
Joined: Wed Sep 10, 2008 3:46 am UTC

Re: Typing code

Postby InkL0sed » Fri Aug 14, 2009 8:10 am UTC

qbg wrote:Dvorak works quite well for me when typing code.


For me too. Probably for the same reason as it's better than QWERTY.

baultista
Posts: 99
Joined: Tue Jun 30, 2009 8:14 pm UTC

Re: Typing code

Postby baultista » Fri Aug 14, 2009 6:36 pm UTC

InkL0sed wrote:
qbg wrote:Dvorak works quite well for me when typing code.


For me too. Probably for the same reason as it's better than QWERTY.

QWERTY was actually designed to limit typing speed. I recall reading somewhere that they had to do this on typewriters to prevent early typists from jamming keys.
Could God write a program so long that not even he himself would have the memory to compile it in a single pass? -- Hamish Campbell

dasada122
Posts: 88
Joined: Sun Jun 14, 2009 8:41 pm UTC
Location: Wherever you aren't looking at the moment.

Re: Typing code

Postby dasada122 » Fri Aug 14, 2009 6:49 pm UTC

Here's another idea: gross motor keyboard.
I have problems with fine motor control, as do many. But what if you took one of those projected keyboard things and scaled it up, projecting on a wall with dead space between keys? You could just have the detection gear and paint the letters on the wall if projection of that magnitude is a problem. Instead of moving a finger a fraction of an inch with no margin for error, you could move your entire arm! And with a bit of null area between keys, you wouldn't have to worry about mistyping- if you miss, you see that the letter doesn't come up and thwack again.
The size would probably be a bit less than the length of your spread arms.

User avatar
InkL0sed
Posts: 205
Joined: Wed Sep 10, 2008 3:46 am UTC

Re: Typing code

Postby InkL0sed » Fri Aug 14, 2009 7:11 pm UTC

That would be tiring...

User avatar
jaap
Posts: 2094
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

Re: Typing code

Postby jaap » Fri Aug 14, 2009 7:29 pm UTC

baultista wrote:
InkL0sed wrote:
qbg wrote:Dvorak works quite well for me when typing code.
For me too. Probably for the same reason as it's better than QWERTY.
QWERTY was actually designed to limit typing speed. I recall reading somewhere that they had to do this on typewriters to prevent early typists from jamming keys.

That is not true. The qwerty arrangement allowed typists to type at their regular or faster speed without the typewriter mechanism jamming. It was not designed to slow typists down and thereby cause less jamming, but the exact opposite - it was designed to cause less jamming and so speed them up.

elminster
Posts: 1560
Joined: Mon Feb 26, 2007 1:56 pm UTC
Location: London, UK, Dimensions 1 to 42.
Contact:

Re: Typing code

Postby elminster » Sat Aug 15, 2009 6:48 am UTC

I guess there is too much of an issue of mainly right hand part of the keyboard being used. When I'm typing large bodies of text I often have to press a different key almost every single time, which is spread such that you can use all 10 digits, but when coding I often find myself typing brackets, parentheses, semi colons, etc (C++ based languages) so many times that any standard typing practices seem pointless. The right shift key gets used one hell of a lot while coding.
Image

aldld
Posts: 35
Joined: Thu Jun 18, 2009 3:16 am UTC

Re: Typing code

Postby aldld » Sat Aug 15, 2009 6:53 am UTC

I usually use the normal touch-typing position, except with a few fingers of my right hand positioned a bit closer to the brackets and parentheses. Sometimes my riht hand is also over HJKL for use in Vim.

JordyD
Posts: 2
Joined: Fri Jun 12, 2009 2:56 am UTC

Re: Typing code

Postby JordyD » Sun Aug 16, 2009 6:52 pm UTC

jaap wrote:
baultista wrote:
InkL0sed wrote:
qbg wrote:Dvorak works quite well for me when typing code.
For me too. Probably for the same reason as it's better than QWERTY.
QWERTY was actually designed to limit typing speed. I recall reading somewhere that they had to do this on typewriters to prevent early typists from jamming keys.

That is not true. The qwerty arrangement allowed typists to type at their regular or faster speed without the typewriter mechanism jamming. It was not designed to slow typists down and thereby cause less jamming, but the exact opposite - it was designed to cause less jamming and so speed them up.

The only way to prevent jamming is to make sure they are not typing two characters at the same time, in order to do that, you must slow down the typist. QWERTY was in fact made to slow down typists. If a typewriter was jammed, you needed to send it in to be repaired, so 'speed them up' was not the goal, but rather 'make sure their typewriter doesn't jam'.

See this: http://en.wikipedia.org/wiki/QWERTY#History_and_purposes

Even if you don't trust Wikipedia, there are plenty of references there.

aldld wrote:I guess there is too much of an issue of mainly right hand part of the keyboard being used. When I'm typing large bodies of text I often have to press a different key almost every single time, which is spread such that you can use all 10 digits, but when coding I often find myself typing brackets, parentheses, semi colons, etc (C++ based languages) so many times that any standard typing practices seem pointless. The right shift key gets used one hell of a lot while coding.


Programmer's Dvorak gets rid of the need for using the shift key while programming in C-based languages.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Typing code

Postby You, sir, name? » Sun Aug 16, 2009 7:16 pm UTC

JordyD wrote:
jaap wrote:
baultista wrote:
InkL0sed wrote:
qbg wrote:Dvorak works quite well for me when typing code.
For me too. Probably for the same reason as it's better than QWERTY.
QWERTY was actually designed to limit typing speed. I recall reading somewhere that they had to do this on typewriters to prevent early typists from jamming keys.

That is not true. The qwerty arrangement allowed typists to type at their regular or faster speed without the typewriter mechanism jamming. It was not designed to slow typists down and thereby cause less jamming, but the exact opposite - it was designed to cause less jamming and so speed them up.

The only way to prevent jamming is to make sure they are not typing two characters at the same time, in order to do that, you must slow down the typist. QWERTY was in fact made to slow down typists. If a typewriter was jammed, you needed to send it in to be repaired, so 'speed them up' was not the goal, but rather 'make sure their typewriter doesn't jam'.

See this: http://en.wikipedia.org/wiki/QWERTY#History_and_purposes


Typewriters jam when you press two keys so that two hammers next to eachother punch down at (almost) the same time. So it's only necessary to make such situations as rare as possible. "The" occurs often in English, so T can't be right next to H, and H can't be right next to E, and so on. As long as you press keys whose hammers are not neighbors, it doesn't matter how fast you type.

If you have a typewriter layout where this is not taken into consideration, you need to type very slowly to avoid jams. So QWERTY would allow the typist to speed up, not down.
Last edited by You, sir, name? on Sun Aug 16, 2009 7:21 pm UTC, edited 1 time in total.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
jaap
Posts: 2094
Joined: Fri Jul 06, 2007 7:06 am UTC
Contact:

Re: Typing code

Postby jaap » Sun Aug 16, 2009 7:18 pm UTC

JordyD wrote:
jaap wrote:
baultista wrote:QWERTY was actually designed to limit typing speed. I recall reading somewhere that they had to do this on typewriters to prevent early typists from jamming keys.

That is not true. The qwerty arrangement allowed typists to type at their regular or faster speed without the typewriter mechanism jamming. It was not designed to slow typists down and thereby cause less jamming, but the exact opposite - it was designed to cause less jamming and so speed them up.

The only way to prevent jamming is to make sure they are not typing two characters at the same time, in order to do that, you must slow down the typist.


Typewriters indeed jam when you type two letters at the same time, but no typist does that. The problem lies in how quickly you can follow one keypress by another. The mechanics of the typewriter is such that keys that are far apart can be pressed in quicker succession without jamming than keys that are close together. The qwerty layout was chosen so that some of the common consecutive letter pairs in English are separated. This allowed most words to be typed faster than the alphabetic layout.

http://home.earthlink.net/~dcrehr/whyqwert.html

JordyD wrote:If a typewriter was jammed, you needed to send it in to be repaired, so 'speed them up' was not the goal, but rather 'make sure their typewriter doesn't jam'.

A typewriter doesn't break or need to be repaired when it jams. You just have to pull back the hammers that have become stuck.

User avatar
Geekthras
3) What if it's delicious?
Posts: 529
Joined: Wed Oct 03, 2007 4:23 am UTC
Location: Around Boston, MA

Re: Typing code

Postby Geekthras » Sun Aug 16, 2009 8:07 pm UTC

I suck at typing at this point. I've been trying to get better but I have abandoned entirely my poor pinkies, even when typing right shift or something...
Wait. With a SPOON?!

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Typing code

Postby '; DROP DATABASE;-- » Mon Aug 17, 2009 5:19 am UTC

I'm sure Snopes said QWERTY was not designed to slow people down. I can't find the article now though; their search function is utterly useless.
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

User avatar
Jorpho
Posts: 6279
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: Typing code

Postby Jorpho » Tue Aug 18, 2009 7:04 pm UTC

'; DROP DATABASE;-- wrote:I'm sure Snopes said QWERTY was not designed to slow people down. I can't find the article now though; their search function is utterly useless.
You Google <snopes qwerty> and this is the third result - which is at The Straight Dope, but close enough.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 7 guests