The Dyslexic Programmer



  • NB: This isn’t intended to be insulting to dyslexic people as such, well I hope not anyway.


    Several years ago I was working at a small IT firm in Nottingham UK. We’d taken on an MFC programmer to port our existing Win32 application to create a “Version 2”. I suppose the alarm bells should have been going off as soon as he came in for the first day with a bag load of MFC books. However he was given the task of coding a fairly simple configuration dialog which had several tabs worth of options.


    It’s slightly hazy as to how long he spent on it, or whether he left or was sacked but a few weeks later I was given the task of fixing/finishing said application. It compiled without any errors/warnings and did “appear” to work but the settings didn’t save to the right places at all.


    On closer inspection of the code it was full of three to five letter variable names which although logically were the first letter of the description of the option, they weren’t exactly readable, especially given the non random distribution of letters meant that there were loads with only a single letter different.


    Looking back it’s a WTF moment that I didn’t just scrap the lot of it and/or do a search and replace, but for some reason I decided to fix it and nearly went cross eyed staring all these variables called: pptp, pstp, pqsd, etc. It me hours to fix it, and I could never understand how someone with “Word Blindness” could possible “see” these names given how hard a time I had.



  • In other words, this programmer implemented it in SAP style.



  • What IDE were you using though? Without some sort of intellisense/autocorrect feature, I guess it's possible that a dyslexic progammer might have more luck with shortened names. More cryptic sure, but fewer letters to get mixed up as well.

    deliveryAddress > devileryArddess, delivreyAdress, etc
    has so many potential mistakes that it's not funny.

    "dA" doesn't.

    Of course, they're hard errors that'll be caught by the compiler, but mixing up "pptp", "ptpp", "pqtp", etc. - all valid values - is admittedly a more subtle and hard to track down problem.



  • @RayS said:

    What IDE were you using though? Without some sort of intellisense/autocorrect feature, I guess it's possible that a dyslexic progammer might have more luck with shortened names. More cryptic sure, but fewer letters to get mixed up as well.

    deliveryAddress > devileryArddess, delivreyAdress, etc
    has so many potential mistakes that it's not funny.

    "dA" doesn't.

    Of course, they're hard errors that'll be caught by the compiler, but mixing up "pptp", "ptpp", "pqtp", etc. - all valid values - is admittedly a more subtle and hard to track down problem.


    If you mistype deliveryAddress, chances are the compiler will notice it. Even if not, because it's e.g. a literal SQL string in a Java program, testing will immediately expose the bug. Possible misstyping because of long names is a small problem during the "creation" part of the life cycle of the problem.
    On the other hand, short names like dA are much harder to read; chances are that mistyping gives you another valid identifier. For example, in a certain API in SAP, there are fields called VSOLM and NSOLM. In most cases, both contain the same value, so if you access the wrong field, chances are you won't notice during tests. But this is obviously a time bomb. Short names cause large problems during the "maintenance" part of the software life cycle.



  • @ammoQ said:

    @RayS said:
    What IDE were you using though? Without some sort of intellisense/autocorrect feature, I guess it's possible that a dyslexic progammer might have more luck with shortened names. More cryptic sure, but fewer letters to get mixed up as well.

    deliveryAddress > devileryArddess, delivreyAdress, etc
    has so many potential mistakes that it's not funny.

    "dA" doesn't.

    Of course, they're hard errors that'll be caught by the compiler, but mixing up "pptp", "ptpp", "pqtp", etc. - all valid values - is admittedly a more subtle and hard to track down problem.


    If you mistype deliveryAddress, chances are the compiler will notice it. Even if not, because it's e.g. a literal SQL string in a Java program, testing will immediately expose the bug. Possible misstyping because of long names is a small problem during the "creation" part of the life cycle of the problem.
    On the other hand, short names like dA are much harder to read; chances are that mistyping gives you another valid identifier. For example, in a certain API in SAP, there are fields called VSOLM and NSOLM. In most cases, both contain the same value, so if you access the wrong field, chances are you won't notice during tests. But this is obviously a time bomb. Short names cause large problems during the "maintenance" part of the software life cycle.


    I agree with you totally, I was just suggesting a possible motivation for the guy. I have no idea what it's like to be truly dyslexic, but I don't think it's too much to suggest a "less typing = better" mentality is possible, especially if using a basic IDE that doesn't flag up mistypes.



  • We all know full well why this was done.  The guy hailed from a
    time when variable names were limited to six or eight characters. 
    Or perhaps he was worried about running out of space in the symbol
    table!

    								</span>


  • @RayS said:

    I guess it's possible that a dyslexic progammer might have more luck with shortened names. More cryptic sure, but fewer letters to get mixed up as well.

    deliveryAddress > devileryArddess, delivreyAdress, etc
    has so many potential mistakes that it's not funny.

    IS THIS TRUE!?  Does dyslexia actually affect their typing as well or as much as their reading ability?  I don't think so. [^o)]

    That's some wierd thinking along these lines: "Let's type that word with different keys although I think it's the same wdro I typed a minute ago". [:P]



  • @TomCo said:

    IS THIS TRUE!?  Does dyslexia actually
    affect their typing as well or as much as their reading
    ability?  I don't think so. [^o)]





    Well, my mother has a bit of dyslexia, and it doesn't terribly affect
    her ability to read, but it does make it very difficult for her to
    spell words correctly.



    It's difficult to be sure, but I believe I inherited a smattering of
    it, which manifests itself mostly in the reversal of some letters while
    typing.  Not randomly, but usually when each version makes
    sense.  For example, DSN versus DNS. 



    I type fairly fast, so it's hard to be sure, but it seems to me that
    when I make such typos, it was the correct spelling (it's not always
    acronyms, of course) that I was thinking of.  Only by re-reading
    what I had written would I notice the error (or when the compiler tells
    me).



    When reading, something similar occasionally tricks me into misreading
    a word.  As you've no doubt seen from the examples of legible text
    with all vowels removed, or all interior letters shuffled, we don't
    read words literally like someone just learning how to read
    would.  We recognize the word by context, length, consonants,
    diphthongs, and/or other clues. 



    If you transpose 'ie' in a word into 'ei' while reading, it may be
    interpreted as a different word entirely, especially when both words
    fit (so far) into the current context.  This almost always leads
    to a point where the context makes the incorrectly read word
    nonsensical, resulting in a re-read of the word in question (which can
    sometimes be surprisingly different from what it was initially read as).



    In this case, I suspect the programmer was merely a poor typist, and
    used small variable names to avoid hunting and pecking more than
    required.  A truly dyslexic programmer would benefit more from
    longer, unambiguous variable names, where the compiler can an effective
    spell checker.



    Personally, I can't stand that programming style, even when it's well
    commented.  I use long, descriptive variable and function names,
    and a syntax that's easy to read.  That's probably because I hate
    commenting code, so I make the code self-commenting whenever possible.




  • As someone who's cixelsyd, I (personallly) find it easier to use longer, more descriptive variable names; mistakes are more likely to be flagged by the compiler/syntax-highlighter. As someone who learned to program before Fortran IV, where 6 character variable names were the rule, I can see how someone who's been programming a long time might have learned to program in that way, but I don't know anyone who still does it that way (can anyone possibly remember what those cryptic variable names mean?). That person was either lazy, trying to create job security, or possibly sabotoging things before leaving.+



  • A slightly offtopic question: For the last 20 years, whenever I wrote something, I almost always wrote it on the computer.
    Now I've noticed that I'm rather dyslexic when writing by hand. Anyone else noticed that phenomenon?



  • @codeman said:

    ... I (personallly) find it easier to use longer, more descriptive variable names; mistakes are more likely to be flagged by the compiler/syntax-highlighter ...


    That's exactly what I thought myself; surely long names are better, they certainly are for the vast majority of people. And I doubt he'd ever used any language which had such a short symbol limit as I don't think he'd be old enough.



  • No, but I know a little boy who's dyslexia was a big handicap at school that was surprisingly able to enter a level-password like "xkrcbntdq" with the gamepad of his games console in one shot without a mistake !

     



  • @Ixpah said:

    I suppose the alarm bells should have been going off as soon as he came in for the first day with a bag load of MFC books.

    I fail to grasp how this is "alarming"...  Especially since I strongly doubt that the technique he used was taught by any of said books.



  • @Kilwch said:

    No, but I know a little boy who's dyslexia was a big handicap at school that was surprisingly able to enter a level-password like "xkrcbntdq" with the gamepad of his games console in one shot without a mistake !


    Dyslexia is having problems with viewing letters and words as meaningful entities, and/or translating between speech to text.

    xkrcbntdq is just random chars and completely bypasses the word-blindness of a dyslectic. Compare it to colour-coding, if you will.

    I can type in my webmail password in a jiffy, even though it's a random string of chars and numbers. I remember it in a mechanical way. Which proved a bitch when my brain hiccupped and I couldn't write my password anymore. I had to carefully reconstruct it from memory before I could access my mail again. :D



  • @ammoQ said:

    A slightly offtopic question: For the last 20 years, whenever I wrote something, I almost always wrote it on the computer.
    Now I've noticed that I'm rather dyslexic when writing by hand. Anyone else noticed that phenomenon?


    Nah.

    But I write a lot by hand also.

    I do notice that I sometimes write up plans, completely unrelated to programming, in pseudo-code.



  • @Thanny said:

    @TomCo said:

    IS THIS TRUE!?  Does dyslexia actually affect their typing as well or as much as their reading ability?  I don't think so. [^o)]



    Well, my mother has a bit of dyslexia, and it doesn't terribly affect her ability to read, but it does make it very difficult for her to spell words correctly.

    It's difficult to be sure, but I believe I inherited a smattering of it, which manifests itself mostly in the reversal of some letters while typing.  Not randomly, but usually when each version makes sense.  For example, DSN versus DNS. 

    I type fairly fast, so it's hard to be sure, but it seems to me that when I make such typos, it was the correct spelling (it's not always acronyms, of course) that I was thinking of.  Only by re-reading what I had written would I notice the error (or when the compiler tells me).

    When reading, something similar occasionally tricks me into misreading a word.  As you've no doubt seen from the examples of legible text with all vowels removed, or all interior letters shuffled, we don't read words literally like someone just learning how to read would.  We recognize the word by context, length, consonants, diphthongs, and/or other clues. 

    If you transpose 'ie' in a word into 'ei' while reading, it may be interpreted as a different word entirely, especially when both words fit (so far) into the current context.  This almost always leads to a point where the context makes the incorrectly read word nonsensical, resulting in a re-read of the word in question (which can sometimes be surprisingly different from what it was initially read as).

    In this case, I suspect the programmer was merely a poor typist, and used small variable names to avoid hunting and pecking more than required.  A truly dyslexic programmer would benefit more from longer, unambiguous variable names, where the compiler can an effective spell checker.

    Personally, I can't stand that programming style, even when it's well commented.  I use long, descriptive variable and function names, and a syntax that's easy to read.  That's probably because I hate commenting code, so I make the code self-commenting whenever possible.

    Thanks.  I appreciate your explanation.  I apologize to anyone who thought of my original comments as some sort of trolling flame.  I just get carried away when I have a few too many Pepsi's! ;)



  • @TomCo said:

    IS THIS TRUE!?  Does dyslexia actually affect their typing as well or as much as their reading ability?  I don't think so. [^o)]

    <font size="5">I</font> believe I am numerically dyslexic since I cannot look at a phone number and then dial it without transposing at least one set of digits.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.