• RFlaum (unregistered)

    I submitted the first one, but apparently it got mangled at some point -- either I copied it wrong somehow or Remy changed it after I submitted it. The original comment had "it does work", not "it doesnt work".

    A quick addendum: the guy who wrote that comment was dyslexic, so we should cut him some slack for the spelling errors.

  • 516052 (unregistered) in reply to RFlaum

    We live in a world where spell checkers exist. So no we shouldn't.

  • ThunderBird90 (unregistered)

    Oh, a chance to cite the classic SO question: https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered

    CAUTION: will end your day of productivity!

  • RFlaum (unregistered) in reply to 516052

    What IDE has a spellchecker?

  • (nodebb)

    Found in some viciously tangled code back in the day, written by a long-since-former cow-orker:

    /* This doesn't work and I don't know why not. */
    

    I peeled back the layers of tangle, and (accurately) diagnosed the bug by manual static analysis in about ten minutes.

  • (nodebb) in reply to RFlaum

    ReSharper for Visual Studio adds a spell-checker (and I would expect Rider). I've seen it spot a lot of typos by developers and the very occasional one by myself.

  • (nodebb)
    // TODO: handle this correctly
    

    My safety net for TODOs is to prefix them with my initials, EG: "TODO JL: Don't forget to fix here", then before I create a PR I ensure there are no more "TODO JL" occurrences in the code base.

    We also have a general rule that PRs can't go in with TODOs without a Jira issue number.

  • Coward (unregistered)

    The Nullable bool is not actually a wtf. Asp.net frameworks (or at least mvc up until 6) will use the model value to fill the form (very helpful!). But not very helpful if you actually want the user to pick between true or false. For example, if rendered as a radio collection, a nullable bool would have no radio checked. A Bool one would have the false value picked by default.

  • 516052 (unregistered) in reply to RFlaum

    All the ones I worked in recently have it either built in or available as a plugin.

    And even if that was not the case, as someone with a disability that he is aware of, he has a duty to do his part to fix the errors that stem from this disability. Which in this case means finding a way to spell check things even if the process is as painful as copy pasting the text into notepad++, spell checking it and than sending it back.

  • Industrial Automation Engineer (unregistered) in reply to 516052

    I have Tourette's Syndrome, you fucking moron!

  • TheJayMann (github) in reply to 516052

    spell checking it and then sending it back FTFY

  • TheJayMann (github)

    In so far as the data annotations applied to the Nonbillable property, it depends on whether this is applied to a class that is meant to represent data in the data store, or if it is meant to represent parsed or user input. In the latter case, it may be useful to have it be required while allowing a null value in the case the value was not supplied in the input so that the input can be parsed as much as possible rather than giving up and not being able to parse anything out. If it is used to represent the data store, then this is just a bad design. And, if it is meant to both represent the data store as well as the supplied input, this is one of the main reasons to represent them using different types.

  • Andrew (unregistered) in reply to Jonathan Lydall

    Those aren't prefixes.

  • (nodebb)

    Ehh, tight deadlines and rare edge cases do tend to spawn the occasional "TODO FIXME LATER". ¯_(ツ)_/¯

  • Tree (unregistered)

    I've 100% written "TODO: handle this correctly" before and put it into 'production'.

  • Brian (unregistered)
    // TODO: handle this correctly

    Oh, how many times I've written similar comments. Although I usually prefer to be more verbose: "// Can't do this the right way for such-and-such a reason, so just hacking it for now until we can fix the underlying problem"

    And regarding spelling, I generally forgive spelling errors in comments (and fix them when I come across them). What I hate is spelling errors in variable or method names. Even worse if it's in a library so you can't just change it without breaking everything. And a subcategory of that is folks who don't know proper pluralization rules; I currently work in accounting software, and I cringe every time I see "Accounts Receivables".

  • Duston (unregistered)

    "The Nullable bool is not actually a wtf" I mean, how else are you going to represent FILE_NOT_FOUND?

  • I dunno LOL ¯\(°_o)/¯ (unregistered) in reply to ThunderBird90

    I once put All Your Base Are Belong To Us references in the comments to some initialization code. My big pun was "move all base register". And that was twenty years ago, sigh.

  • (nodebb) in reply to Brian
    What I hate is spelling errors in variable or method names. Even worse if it's in a library so you can't just change it without breaking everything.

    You can go a step farther on the "even worse" scale with spelling errors in published standards. Yes, I'm looking at you, HTTP_REFERER.

  • Ooh lala (unregistered) in reply to Brian

    “Accounts Receivables” are more tolerables once one realize they are Frenches. Is it that there is truth with that, no?

  • (nodebb) in reply to Ooh lala

    once one realize they are Frenches.

    Don't get me started on French people and how they pluralise English adjectives and non-adjective compounds. With a couple of exceptions(1), everyone in my office is a native French speaker (Frenchies almost exclusively, except a couple of guys from REDACTED(3)), and I'm fighting a very-slowly-winning battle to get them to leave adjectives singular and to use a vs an correctly.

    (1) I'm one of them, naturally.

    (2) Mr Adams reminded us that the name of this other country is a very rude word.

    (3) The border between France and [REDACTED] is only a few miles away.

  • (nodebb) in reply to 516052

    Spell Chokers have there on limitations to fox spelling and gram-her arrears, sew we should really give the original righter a brake.

  • Carl Witthoft (google) in reply to Nutster

    Ezzackly. Not to mention that Spall-chickers have no idea whether source code parameter names are spelled correctly or not. And don't even THINK about dealing with case-sensitive variable names!

  • Carl Witthoft (google) in reply to ThunderBird90

    Wow -- that SO page is so old that one of the comments refers to that dark period in history when this site here was named "worsethanfailure"

  • Anon (unregistered)

    I'm very guilty of that "TODO: do this correctly" bit, and totally looking forward to seeing my old code here in a few years. It's...not great, but I sympathize: sometimes you don't have the time or...well, you don't care enough to make the "correct" solution until it becomes an actual problem.

  • Steve (unregistered) in reply to 516052

    Shouldn't that be "so know we wouldn't"?

  • pf (unregistered)

    To be fair to the elisp guy, using an unused parameter like that was the usual Lisp idiom for quite a long time. Common Lisp acquired "(declare (ignore arg))" which is quite clear. I didn't know about the prefix underscore in elisp, so I learned something there; I wouldn't call it "clear," though.

  • Wizofaus (unregistered) in reply to RFlaum

    IntelliJ's is pretty good for the most part, can even detect camelCaseSpelingErrors (sic). I've used plugins for Visual studio too but not as good, it should really have one built in. In my ideal world code with spelling errors for function/ class/variable names wouldn't compile (after all it won't with spelling errors in keywords!).

  • (nodebb) in reply to pf

    Good point actually. It is entirely possible that the byte compiler at some point checked for unused variables but didn't have the underscore convention yet.

    Addendum 2021-09-15 17:14: Still chuckled at the comment though.

  • (nodebb) in reply to TheJayMann

    <3

  • ParityTheUnicorn (unregistered)

    "'After two+ hours, it doesn't work, and I'm not sure I actually did anything,' describes the experience of being a programmer so well, that I honestly think it's my new motto. The key difference is that, if it doesn't work after two hours, you do have to keep going until it does."

    This old song has bad singing, but a counterbalancingly relatable message: https://www.youtube.com/watch?v=li_qgJGWfp8

  • Another coward (unregistered) in reply to Coward

    Yeah, this is best practice for c# APIs where you want to ensure a value was actually submitted by the user instead of using the default value. In fact, the [Required] attribute, with the exception of strings, is useless for non-nullable types - it literally checks for null and if the type is non-nullable it'll therefore always pass. Strings are treat a bit differently and will also fail if they're empty/whitespace, but they're the only exception. Whether it makes sense to force an incoming data payload to specify something vs defaulting the property value to false is down to your business rules.

    That said, I see no reason for the [Range] attribute here at all as there are no other possible values so would chalk that one up as a minor wtf.

  • I dunno LOL ¯\(°_o)/¯ (unregistered) in reply to I dunno LOL ¯\(°_o)/¯

    Yep, it was twenty years ago, and I got it wrong. It was "All your base register are belong to us" when setting up the base address of the hardware unit, and "move zig" and "for great justice" when loading registers. Or something like that. The first things to go are the mem... and... um, you know, the thing.

  • Officer Johnny Holzkopf (unregistered) in reply to Nutster

    Propper speling is- over rated and thatt you dont` need It to show you a goot programer in IT busnes ( especly in Germane wery smart ) and, alway's remember corect gramer and punctazion !! Find further education in Martha Snow's "Spell chequer" starting "Eye halve a spelling chequer / It came with my pea sea" to fully understand how and why the PC always knows everything better than you.

    http://www.davidpbrown.co.uk/poetry/martha-snow.html

  • (nodebb) in reply to Carl Witthoft

    that dark period in history when this site here was named "worsethanfailure"

    Isn't that still the official name?

  • Diane B (unregistered)

    _argh

  • Craig (unregistered)

    A comment like "TODO: Handle this correctly" could also have been added by someone doing maintenance after it was originally written (not the person who wrote the code). I've been known to do that; it's not something that's my immediate concern, the code works adequately, but I still want to throw up a note that it should be improved in the future.

  • (nodebb)

    I'd say the TODO is at least better than the Shenanigans Handler.

Leave a comment on “The Programmer's Motto and Other Comments”

Log In or post as a guest

Replying to comment #:

« Return to Article