• Jaloopa (partially registered) (unregistered)

    private System.Windows.Forms.ComboBox _cb_FR_ist

  • Sole Purpose Of Visit (unregistered)

    I'm going to partly defend this.

    I work with a few dozen Winforms, and at some stage they all degenerate into a confusion of naming conventions (usually label1 rather than button1, because who cares about naming a label?). It's actually pretty rare that I care about naming a control, because, guess what, Visual Studio has a little window that tells you the properties, which is really all you need. Use the power of the Designer, young Jedi!

    I wouldn't be exactly happy if I had to work with this thing, but in practice I'd just rename the controls that actually have meaning to me, and leave the rest alone. Luckily Visual Studio refactors that renaming for me, as well.

    Mind you, I'd question the sanity of the person who came up with the naming scheme in the first place...

  • Sole Purpose Of Visit (unregistered)

    Having said that, I'll bet the event handlers are a peach. I envision something like _CB_LPVB_K_EM3_U, which of course would be the Event for when a button on the Mouse is Up. The particular mouse button is indicated by the number, and three would be left, right, or middle, depending upon the taste (?) of the author.

  • David Mårtensson (unregistered) in reply to Sole Purpose Of Visit

    I mostly agree, especially since you would never ever need to touch most labels in code anyway.

    For fields its another matter as you usually do want to use them.

    But I find that with age comes wisdom and my naming of things today is leagues better than 20 years ago ;) After going back to old code enough times you do learn the value of naming things good to start with.

  • MiserableOldGit (unregistered) in reply to Sole Purpose Of Visit

    Yeah, agreed.

    Although this looks to me like the programmer might be pulling the name property out and parsing it with lumps of code acting on groups of controls according to whether or not they have the right hieroglyphics in the name. That, could of course, be a horrible inner platform mess (yep, seen it, with name and or tag or other properties) or it might be a reasonably neat solution.

    Using decent names rather cryptic little codes would be better, but if it's done consistently I'd actually prefer this to camel case essays inconsistently describing UI controls, where you have to scroll across three screen widths of blither to spot a small difference in name. As you say, using pretty much any designer from the last ten years renders all that irrelevant anyway.

  • Donald Klopper (google)

    Nothing to see here, move right along.

    Another slow day at TheDailyWTF.com

  • 516052 (unregistered) in reply to Donald Klopper

    That is the true WTF here. The fact we are so used to this we don't even care.

  • MiserableOldGit (unregistered) in reply to 516052

    It's just Remy warming usup for Tedious Twaddle Thursday

  • Prime Mover (unregistered) in reply to MiserableOldGit

    As long as it doesn't inspire someone to come out with that tired old fascist bullshit that healthcare is a privilege not a right, and because only 7.8% of Americans need multiple jobs just to exist, then there's no problem with the world, then we should get past that mostly unscathed.

  • MiserableOldGit (unregistered) in reply to Prime Mover

    Oh don't get him going again, even I got bored in the end. Mind you, it was still more entertaining and relevant to TDWTF than that inconsequential fart-fest about Basecamp.

  • NC Steve (unregistered)

    Another logical defense is that the field names correspond to the fields in a database. That makes binding the field to the db much easier.

  • (nodebb) in reply to NC Steve

    It just pushes the problem back a level. Who named the database fields so horribly?

    Addendum 2021-05-19 09:34: EDIT: columns not fields. Sorry CELKO

  • (nodebb) in reply to Prime Mover

    Remy can you delete Prime Mover's out of place political comment above?

  • Naomi (unregistered)

    Guys... it's reader-submitted content. They can only work with what they're given. Lay off, alright?

  • Carl Witthoft (google)

    FWIW I wouldn't mind this set of names, so long as there is a scrupulously-maintained set of documentation stored with the source code which defines each field within the naming structure.
    You can find an example of what I'm thinking of on lots of data sheets for electronic parts or mechanical assemblies, where there's a table explaining what each subfield identifies and the meaning of each value for that field.

  • (nodebb) in reply to Carl Witthoft

    FWIW I wouldn't mind this set of names, so long as there is a scrupulously-maintained set of documentation stored with the source code which defines each field within the naming structure.

    So you think that a button called "button1" is acceptable in any production code? Well, that and its friends numbered (with some gaps) up to 33?

  • Sole Purpose Of Visit (unregistered) in reply to Carl Witthoft

    I'd agree with that, in general, except that "Gormo" specifically states that these names are incomprehensible. Which they certainly wouldn't be, if there were data sheets around.

    Further to that, let's just "parse" the combo boxes for LPVB. Perhaps LPVB is in the data sheet. I doubt that, say, K[/B} would be -- it would be an abbreviation for some property of the [B]LPVB[/B} widget. So, let's stipulate melting point or something in Kelvin ... you'd still prefer to see [B]_CB_LPVB_MeltingPoint.

    Some parts of mapping names to the business domain make sense. Other parts ... don't.

  • Carl Witthoft (google) in reply to Steve_The_Cynic
    So you think that a button called "button1" is acceptable in any production code?

    No, that part shouldn't be there. I would have "hoped" that all those items are dummies with no current effect or use, and only seen in the development branch. Like I wrote, ... only if all names were fully documented.

  • MiserableOldGit (unregistered) in reply to Carl Witthoft

    To be fair, even "Button1" documented properly is better than SubmittedDocumentDocumentObjectSetFocusUnfocusPropertyCommitRejectConsent which turns out to just work like a form cancel ... naming stuff, in it's various forms, seems to be a big part of WTFs, so much so I never assume the name of a method/object/variable is even vaguely descriptive.

  • MiserableOldGit (unregistered) in reply to Prime Mover

    Your comment seemed to trigger a snowflake into demanding his safe space be enforced, but this isn't Parler. Please post to confirm you haven't been censored!

  • (nodebb) in reply to MiserableOldGit

    "I got bored" is euphemism for "I lost", and I just wanted to keep the politics from spreading everywhere; numerous users here asked to keep politics out of these software discussions. We devoted that previous article's comment section to some policy back and forth (which you lost); going forward, let's stick to discussing the software topic at hand.

    Please don't respond here; we can use that article's comments, or perhaps some other medium, to discuss politics/society/policy/any other topics. I'm at your service, I can whoop your ass in any topic of your liking.

  • MiserableOldGit (unregistered) in reply to Mr. TA

    Not really, debating with you is a one way stream. You only "won" if you persuaded me you were right, as oppose to just being an arrogant prick. You might perceive yourself as having "whooped my ass", I'll leave others to judge that, because I thought you had a point, but not a very good one, and you argued it in a fairly mediocre way.

  • (nodebb) in reply to MiserableOldGit

    I wrote, "please don't respond here", mostly to respect others' wishes. But you don't care about either my request or others' wishes.

    How did you put it? "Arrogant prick" - sounds about right.

  • MiserableOldGit (unregistered) in reply to Mr. TA

    "Arrogant prick"

    I'm fine with it. Let's see what others think. You better start setting up some shill accounts to argue your point further as I think you are in a corner now.

  • Vilx- (unregistered)

    Been there, done that. The weirdest thing is that after a few years of names like these they actually start MAKING SENSE and you can figure out even those that you've never seen before. O_O I think that's a sign that you've stared into the Abyss for a bit too long...

  • (nodebb) in reply to MiserableOldGit

    "shill accounts", "in a corner"? Man you crazy, not just mean and a debate loser.

  • MiserableOldGit (unregistered) in reply to Mr. TA

    Is the best you can do? honestly, I'm disappointed ... I thought you might have have had a point, obviously not.

  • Meir (unregistered) in reply to MiserableOldGit

    Oh. So a Gauleiter-wannabe like Prime Mover wants people fired for daring to disagree with his political diktats - no problem. But someone asks for one comment of his to be removed, where there are no lack of other forums where he could let his inner Nazi hang out (heck, he could do it in the previous thread), and you cry censorship. Get bent.

  • WTFGuy (unregistered)

    I now return us to our regularly scheduled rant about IT and this steaming pile of winsome WinForm WTFery.

    I sorted the code snip to get a grip on what the heck it contains.

    59 Buttons. 2 w sensible names, 31 w the cryptic abbrev_abrev_abbrev pattern, and 26 automatically named button## ranging from 1 to 33.

    17 CheckBoxes. All 17 have the cryptic names, but one has a different syntax from everything else on the form.

    40 ComboBoxes. All 40 have the cryptic names, but two have a different syntax from everything else on the form.

    1, count it, one GroupBox probably to try to collect/connect some of the RadioButtons discussed below.

    4 Labels. 1 has the cryptic name, 3 have auto-numbered label## names. But they're 1, 13, & 18. Where are the rest? Darn good question.

    1 ListBoxwith a cryptic name.

    1 , count it, one Panel with a cryptic name to try to organize this amazing agglomeration of controls.

    2 PictureBoxes with autogenerated names. Like in Calvinball or FizzBin, here's where they slip in a bit of actual consistent organization to fool the people who began to believe the whole thing was a put-up job. Their names? PictureBox1 and PictureBox2, exactly what you'd expect. If you weren't already made insane by the rest.

    4 RadioButtons. Two named sorta-sensibly and two in the cryptic pattern. But with only one GroupBox on the page, how do they interact?

    1, yep, one ToolTip with the nice autogenerated name toolTip1. Helping the user understand this dog's breakfast is obviously a high priority for the "dev" (and I use the term loosely) who created this.

    With this inventory what do we learn? Not counting the radiobuttons that are hard to score, there are 59 + 40 + 17 + 1 = 117 opportunities to make inputs on this form. And 4 labels and 1 tooltip to explain what goes where.

    Even if this is only a partial except of the actual designer generated code, 117 inputs on one form is ... Not Right.

  • Chris (unregistered) in reply to WTFGuy

    Just had an awful thought. What if this is actually several forms in one, where most of those 117 inputs will be hidden, depending on what state or mode we're currently in?

  • (nodebb) in reply to WTFGuy

    With this attention to detail, sir, you are hired!!

  • Loren Pechtel (unregistered)

    While there are obvious problems here I think this is an overreaction.

    If I need to actually interact with a control I give it a meaningful name. However, labels rarely need to be interacted with and plenty of buttons don't need to be interacted with (example, the cancel button always cancels, period. You put the "Cancel" on the button and point it at the code that cancels, but you never actually interact with the button in your code--it's probably going to be button##. However, I frequently disable the execute button until the state is suitable to execute, now there's some OnChange code that must enable it and thus it gets a meaningful name.)

    As for WTFGuys's comment about Label1, Label13, and Label18--the form has probably undergone some changes over the years. I've had plenty of cases where the autogenerated numbers are not sequential even without a form evolving. I normally give a meaningful name to a control when I first write a piece of code that actually refers to it.

  • Jinks (unregistered)

    RE: The "Your company's app" comment:

    To be fair, Apple and Google are doing a completely different job there. Try signing up for a Google or Apple account and see what that UI looks like.

  • MiserableOldGit (unregistered) in reply to Meir

    As I'm not Prime Mover and don't really agree with him on that this bit of whataboutism is a waste of electrons.

  • (nodebb)

    Wasn't there a recent TDWTF that was exactly this, only longer?

  • Prime Mover (unregistered) in reply to MiserableOldGit

    I actually was censored a little bit. Mr. TA replied "Shut up" and I replied to him "I thought you were all in favour of free speech."##

    Both posts appear to have been deleted.

  • 516052 (unregistered) in reply to Prime Mover

    That is what we common folk call a hint. And you might want to "get" it.

  • Grunthos the Flatulent (unregistered)

    They are private - any good Winforms developer would be using MVP (Model-View-Presenter) and those names don't matter a fig at that point as long as the IView has decent names.

  • Grunthos the Flatulent (unregistered)

    The bigger problem with this code - seems there's not many good winforms developers here (although surprised others haven't picked up on it) is that there are way too many controls and from the naming you can see they should have been made into their custom controls. Seen this so many times in business code where unqualified, self taught VB.Net "developers" create abominations such as this.....

  • 516052 (unregistered) in reply to Grunthos the Flatulent

    Custom controlls don't always make sense. And they introduce another layer of fiddly that you now have to budget for and maintain. At least if you want to do them right and not just move the abominable code out of sight.

Leave a comment on “Meaningful Article Title”

Log In or post as a guest

Replying to comment #:

« Return to Article