Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^2: The joys of bad code

by stvn (Monsignor)
on Oct 26, 2004 at 14:39 UTC ( #402609=note: print w/replies, xml ) Need Help??

in reply to Re: The joys of bad code
in thread The joys of bad code

I never really understood the whole "I dont want to have to type a long variable/package/class name" school of thought/excuses. Most programmers I know are pretty fast typers and it seems to me that it is worth the upfront time to craft well written code with clear and understandable variable/package/class names. IMO, using short names is the wrong kind of laziness.


Replies are listed 'Best First'.
Re^3: The joys of bad code
by hardburn (Abbot) on Oct 26, 2004 at 15:15 UTC

    Same reason really good note-takers develop a shorthand. It's just faster that way.

    Abbreveations are generally good when they're well-choosen, but poorly-choosen ones suck the big one.

    IBM midrange systems are riddled with bad abbreveations. Could you tell me what a file named "HREMFP" is supposed to have in it? This is an actual file name in a beginners book for midrange programmers/admins that I was given. (And trust me, the name isn't clear from any of the context in the surrounding chapter, either). They love to keep to about 6 characters per file name, weather it could be made shorter or needs to be longer.

    Part of this is technical limitations of the platform, but the limitations seem to be so ingrained in the midrange community that I doubt people would start using sane naming standards even if the technical problems went away.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Re^3: The joys of bad code
by Jenda (Abbot) on Oct 27, 2004 at 16:35 UTC

    TheLongerTheNameIsTheMoreLikekyYouMakeATypo. Of course you should be using strict, but that will not help you with subroutine names in Perl. Both having the names too short and too long is wrong IMHO. Now the question is what the right length is ;-)

    We'd like to help you learn to help yourself
    Look around you, all you see are sympathetic eyes
    Stroll around the grounds until you feel at home
       -- P. Simon in Mrs. Robinson

Re^3: The joys of bad code
by halley (Prior) on Oct 27, 2004 at 17:37 UTC
    I agree.

    To the folks who say that long names are slower to type, or easier to misspell, please do everyone a favor and get a better editor. I don't care which one, but almost all of the good ones have some form of abbreviations or completions. Start typing an identifier, and let the editor suggest the rest of the word for you. One third of the typing, or two hundred percent improvement in readability, depending on your point of view.

    [ e d @ h a l l e y . c c ]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://402609]
Tanktalus is trying to figure out how to get a case-insensitive match between stra▀e and strasse to return true in perl :( fc doesn't seem to do it, either, unless I'm doing it wrong.
[LanX]: ▀,ss
[LanX]: nope
[LanX]: /.*(?:▀|ss).*/
[hippo]: How are you doing the match? Regex, index, eq or something else?
[choroba]: fc $s1 eq fc $s2 I guess
[Tanktalus]: hippo: I don't care, I just want to prove it can match correctly compared to, say, ILIKE / UPPER / LOWER in postgres :)
[LanX]: is there a unicode convention that ▀ is ss ?
[Tanktalus]: LanX: yes :) I haven't tried java, but I have this match working in its bastard cousin, C# :) I just thought perl's unicode support would get me there :)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2018-03-21 15:37 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (268 votes). Check out past polls.