• (nodebb)

    Quite common, but also easily remediated (once one has done it a few time), there even are (were?) some automated tools that could clear up a lot of these default naming issues with decent heuristics. LTI [lest than ideal] sure, but not even close to WTF.

  • Pabz (unregistered)

    I remember doing similar things many years ago with Visual C++ and MFC with its Class Wizard. My colleagues and I did give our controls sensible names though because obviously we wanted to read each other's code!

  • (nodebb)

    And the code shows another special feature of old VB6: the default property. In case of the CheckBox, it is the Checked property.

  • (nodebb)

    The UI designer is a good idea, it exists in other frameworks, too (such as WinForms and WPF). If only it would prompt for the name of the control upon creation, to prevent all this checkBox11 crap.

  • Anonymous') OR 1=1; DROP TABLE wtf; -- (unregistered)

    That brings me back. I remember naming my variables 'poo' back when I was first learned to code in middle school.

  • D-Coder (unregistered)

    Ahhh, the (bad) memories.

    I think I've posted before about the line of VB6 code something like:

    Btn21.visible = true 'false 'true

    where "'" starts a comment. Not only did they use a useless name, and they used the "beat your code until it works" technique, they were careful to preserve the previous code just in case. Just in case they couldn't figure out the old value where it can only be "true" or "false".

  • (nodebb)

    Who knows, maybe they stand for:

    p ==> paix (fr: peace)
    po ==> pièce d'or (fr: gold piece)
    poo ==> programmation orientée objet (fr: object orient(at)ed programming)
    
  • (nodebb) in reply to Steve_The_Cynic

    In out codebase you'll find things like

    x, xp, xpp
    

    where successive P's mean "prime" as in "derivative". It makes sense in the problem domain (x is conventional too) and is documented in comments.

    I suspect that something similar was going on with p, po, poo, but at least it should be documented.

  • xtal256 (unregistered)

    "I understand it doesn't scale to complicated applications..."

    It certainly scales better than writing it all by hand and ending up with a big complicated mess of spaghetti code. Even in a complicated app, the UI designer will help with the mundane stuff.

    Of course, as this article proves, you can still get shit code using the designer. But at least it's limited to the event handler code and not all the boilerplate code that creates UI widgets and hooks up event handlers.

  • (nodebb)

    A name prompt would be good (Visual Studio still doesn't do this!) but allow a default. Most of the time it doesn't matter what a label is called because it will never be referred to. I end up with a decent number of panels that likewise are never referred to--they just need to exist to make resizing the form work smoothly.

  • Your Name (unregistered)
    Comment held for moderation.
  • (nodebb) in reply to Steve_The_Cynic

    Yeah, I'm sure that PoS was definitely a gold piece.

  • (nodebb)

    Years ago I got handed a lump of VB code that provided a GUI front-end for some medical machinery. It was really just a grid of buttons dumped into a window, so barely counted as GUI, but let's get to work... OK, first thing is to undo the random tab order of the buttons and get them in logical order, which apparently astounded the original devs when they found out that focus wasn't supposed to jump randomly around the button grid every time you hit tab.

    Then we'll rearrange them in workflow order... and remove about half the buttons that aren't needed and put a lot of the rest in a combobox... and add some labels... about two days' work later it had gone from a prizewinning candidate at that site where you submitted bad UI to to something that was actually usable.

  • nedalic142 (unregistered)
    Comment held for moderation.
  • Peter D (unregistered)
    Comment held for moderation.
  • Craig (unregistered)
    Comment held for moderation.
  • Hi (unregistered)
    Comment held for moderation.
  • Hi (unregistered)
    Comment held for moderation.

Leave a comment on “Check Out This Legacy App”

Log In or post as a guest

Replying to comment #:

« Return to Article