• LZ79LRU (unregistered)

    This looks like something that would make a great IDE plugin. Maybe combine it with some XML customization and a nice interface and call it a localization manager. And than you can set it up to run automatically when someone does a git pull generating a giant region full of autogenerated methods like that one.

  • Labasta (unregistered)

    Not as simple as all that.

    If you have published the misspelled method as part of an API, then you're stuck with it.

    Hence this is not a WTF beyond the usual TRWTF of the tedious cliché that a) code monkeys are either illiterate or dyslexic or otherwise challenged and b) nobody saw fit to do a code review.

  • (nodebb)

    Someone has missed his lesson about proper iteration termination in the high school.

  • (nodebb)

    Reminds me of creat(2) from UNIX. https://en.wikiquote.org/wiki/Ken_Thompson

    Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: "I'd spell creat with an e."

  • Pabz (unregistered) in reply to Labasta

    That's true - you are stuck with the misspelled function name for now, but you could say something like "The getCheckoutMehod function is deprecated and will be removed completely in a future release of the API."

  • ichbinkeinroboter (unregistered)

    cspell './src/**/*.{ts,tsx,js,json,md,yaml,yml}' in the pipelines

  • LZ79LRU (unregistered)

    I wonder if AI could be used to spell check code.

  • (nodebb)

    "You're entire team"?

  • (author) in reply to jkshapiro

    Should I have put quotes around it to make it clear the misspelling was intentional?

  • Naomi (unregistered)

    I'd have gone with "you're entire team shares the same misppelling habbits" or something.

  • Brian (unregistered) in reply to LZ79LRU

    I use ReSharper which, among numerous other useful tools, includes a spell checker. It's helpful in catching my tendency to transpose letters when I get to typing too fast. It's also frequently annoying because my team officially uses British spellings, but I never bothered to change the dictionary from the default US.

  • (nodebb) in reply to Remy Porter
    Which is fine if you're working alone

    You misspelled your.

  • Sou Eu (unregistered) in reply to Labasta

    The referer header is an excellent example of a misspelling which can't be fixed.

  • The Dave G (unregistered)

    In object oriented programming, if you're classes and name spaces have names like "object" or "manager", your doing it wrong.

    Combined with misspelling, hour team took that to a new level. CommonObjectManager and CommonObjectManger. With the same methods, with different and sometimes identical signatures.

    P.S. These captchas stink.

  • (nodebb) in reply to jkshapiro

    Look, sometimes you're entire team, but that might not necessarily imply your working alone.

    (All word choices above are intentional, and in a mind-warping way, the result might even be considered grammatically correct. Or at least, incorrect for a different reason from the obvious.)

  • dusoft (unregistered) in reply to LZ79LRU

    Or your IDE can just correct the method names without the need to generate all those alternate spellings, right?

  • dusoft (unregistered) in reply to Sou Eu

    Touché!

  • (nodebb)

    Whatever happened to InterLisp's "DWIM" feature, which would automatically correct misspellings?

    Hardly a day goes by when someone doesn't post a question to Stack Overflow where the problem is because they wrote arrayname.lenght.

  • ricecake (unregistered)

    On a Linux server I used to use, when you would type "sl", you would get an animation of a train on your terminal.

    Description of the "sl" command: Displays animations aimed to correct users who accidentally enter sl instead of ls. SL stands for Steam Locomotive.

  • (nodebb)

    One from a past code base that always seemed like a particularly bad misspelling: setPirmaryStatictic

  • AP (unregistered) in reply to Remy Porter

    Yes, quites would have made it obvious that the misppeling was international.

  • GO (unregistered)

    Calendar ;-)

  • Jinpa (unregistered)

    Don't forget the Mozilla image processing library libpron.

  • cschneid (unregistered)

    In an old (1970s era) code base, we used particular (and peculiar) misspellings as leading indicators of authorship.

  • (nodebb) in reply to Remy Porter

    Is that your (you're?) version of "it's not a bug, it's a feature"?

  • Duston (unregistered)

    "All word choices above are intentional" Translated to Latin: "[sic]"

  • (nodebb) in reply to The Dave G

    I look forward to your future TDWTF submission where a colleague has cut and paste most of the code into a new SepareteObjectMangler because they have a new class (because reasons) with slightly different logic (also because reasons) and they don't want to add an if statement and then have to test all the other classes to make sure they hadn't broken anything.

  • DeeKay (unregistered) in reply to jkshapiro

    I think this is lost on most. IMHO English should just drop all apostrophes entirely, since people just never seem to get them right.

  • LZ79LRU (unregistered) in reply to dusoft

    But that would not encourage bad practices, confusing boilerplate code and would generally stifle expression. Imagine if everyone was free to code in their own style and than export their code as a DLL whose interface is AI generated to contain machine translations of method names in different languages customizable by developer preference. The glorious mess that would cause brings a tear to my eye.

  • (nodebb) in reply to The Dave G

    CommonObjectManger

    Who wants to eat common objects?!

    (Sorry for the frenglish joke, I'll see myself out now)

  • (nodebb) in reply to dusoft

    PHP doesn't have a nameof operator like C#, so there's your first potential code breaking issue. Secondly, even worse, PHP for the long time you also referred to functions/methods via strings for dynamic calls. So that's another huge code breaking trap.

    So yeah, renaming methods only works if a) you work in a framework/language with proper save refactoring support on a framework/language level and secondly and most important, you don't have a bunch of devs writing code that can't be refactored while claiming it's premature optimization or violates KISS/DRY because they are the bad kind of lazy and need an excuse for shitty code.

    Obviously both examples are highly common, hence renaming methods can be impossible to do in a safe way to detect issues before the product increment ends up in the production stage.

  • To (unregistered)

    I'll let you imagine the state of spelling in a team whose native language is other than English, but who have to use English names nonetheless. There's typos, misspellings, barbarisms, and that one guy who can't decide which language he uses, so you have to be bilingual to understand his code anyway.

  • (nodebb) in reply to Labasta

    Or they did a code review, but that spelling is a contribution from their now-CEO.

  • TF (unregistered)

    I've done this plenty of times but only because the mis-spelled symbol was part of a previously released public API.

  • dusoft (unregistered) in reply to MaxiTB

    Then introducing duplicate misspelled methods and immediately deprecating/outdating them is your choice for next version.

  • kolik (unregistered) in reply to LZ79LRU

    it already exists in the form of a linter called cspell. I know because 10 minutes of my day today were wasted adding words to our cspell file. the words were some tool-specific thing that i had written in a new markdown document. in my opinion it's stupid because we already have about 3 different linters. if you see a typo in the code just fix it with a refactoring tool (very easy to do these days) and include it in your PR

  • Strahd Ivarius (unregistered)

    it is neither calender nor calender, it is obviously colander!

Leave a comment on “Cast a Different Spell”

Log In or post as a guest

Replying to comment #:

« Return to Article