• Vera (unregistered)

    My best/worst guess for what this is meant for: aligning something with the longest string. Like, write something to console, CR to jump to start of line, write the "prefix" to console, then write whatever should come after.

    Of course, this is just a guess, but it's the kind of kludge I'd expect with code this clumsy-looking.

  • (nodebb)

    My years of experience tell me that, clearly, the method named "ErrorForm" actually logs and/or emails the exception so that the developers are made aware of the problem and can fix it.

  • Hanzito (unregistered) in reply to dpm

    And once everybody got fed up of errors that were never fixed, public override ShowDialog() {} was added to ErrorForm.

  • (nodebb)

    I've seen this one before but in this instance the inner code did produce a error with MessageBox so in case of error the user had to start closing MessageBoxes until the code ran out of messages. They fixed it by putting all the error messages in a StringBuilder and displaying a single hard to read MessageBox covering half of the screen. Wasted work if you ask me because most users, in my experience, don't read error messages.

  • PedanticRobot (unregistered)

    What a bunch of unnecessary garbage creation, and a for loop wouldn't be any better than a while loop when `new string(' ', maxLength)' would do the job in one line without throwing away any garbage strings.

  • Anonymous (unregistered)

    Why Prefix? Because you then do left(strPrefix, len(strPrefix)-len(strLabel)+strLabel) and get right-aligned labels. Clearly on a fixed-width terminal, even on the new-fangled amber ones :-)

  • (nodebb) in reply to AGlezB

    Wasted work if you ask me because most users, in my experience, don't read error messages.

    Users don't read the error messages even when they say "your error is here and this is how you fix it".

  • (nodebb)

    Users don't read the error messages

    Users, I'm happy when testers and support read error messages. In a previous job, the bug tracker was littered with hundreds of bugs that said "user got an error when ...". In most cases, it turns out that the error (which the support person never read) was "User is not authorized to perform operation XXXX".

  • (nodebb)

    Straight to prison, 25 to life.

  • (nodebb) in reply to Jaime

    I wish some of my fellow developers would read error messages just a little more often...

  • Lothar (unregistered)
    Comment held for moderation.

Leave a comment on “Spaced Out Prefix”

Log In or post as a guest

Replying to comment #:

« Return to Article