José received a bit of VB .Net UI code that left him scratching his head.

While IsNothing(Me.FfrmWait)
    If Not IsNothing(Me.FfrmWait) Then
        Exit While
    End If
End While

While a form doesn’t exist, if the form does exist, break out of the loop. I suspect this was intended as a busy loop, waiting for some UI element to be ready. Because busy loops are always the best way to wait for things.

But even with the busy loop, the If is a puzzle- why break out of the loop early, when the loop condition is going to break itself? Did they just not understand how loops work?

Now, the last thing to note is the variable naming conventions. frmMyForm is a common convention in WinForms programming, a little bit of Hungarian notation to tell you what the UI element actually is. But what’s that *leading F there? Are they… doing a double Hungarian? Does it tell us that this is a form? Or maybe they’re trying to tell us that it’s a field of the class? Or maybe a developer was saying “F my life”?

We’d all be better off if this code were nothing.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!

Remy Porter

Source link

You May Also Like

Interview with Rupert Murdoch – Dean Kaner, Humor Times

Wherein our intrepid talk radio show host interviews News Corp CEO Rupert…

Mike Luckovich for Oct 14, 2022 – Mike Luckovich, Humor Times

Mike Luckovich of the Atlanta Constitution received two amazing honors in 2006,…

Comic book royal rumble

Tags: madame web, spiderman, meme 6555 points, 400 comments. Source link

Face Me, Coward! – People Of Walmart

The post Face Me, Coward! appeared first on People Of Walmart. Luke…