Enum from the dark VB6 corner of our repository



  • There's a dark and murky corner of our code base that is written in VB6. Nobody likes to talk about it much, and we all know that eventually we're going to have to do something about it, but since it's fairly stable it's here to stay for at least a little while longer.

    Anyway, for some reason or another I had to go spelunking down into the depths and stumbled across the following two enums. Not a major :wtf: but it still made me shake my head.

    Public Enum DaysInMonthCategory
        dmcTwentyEight = 28
        dmcTwentyNine = 29
        dmcThirty = 30
        dmcThirtyOne = 31
    End Enum
     
    Public Enum DaysInMonth
        dimJanuary = DaysInMonthCategory.dmcThirtyOne
        dimFebruary = DaysInMonthCategory.dmcTwentyNine
        dimMarch = DaysInMonthCategory.dmcThirtyOne
        dimApril = DaysInMonthCategory.dmcThirty
        dimMay = DaysInMonthCategory.dmcThirtyOne
        dimJune = DaysInMonthCategory.dmcThirty
        dimJuly = DaysInMonthCategory.dmcThirtyOne
        dimAugust = DaysInMonthCategory.dmcThirty
        dimSeptember = DaysInMonthCategory.dmcThirty
        dimOctober = DaysInMonthCategory.dmcThirtyOne
        dimNovember = DaysInMonthCategory.dmcThirty
        dimDecember = DaysInMonthCategory.dmcThirtyOne
    End Enum
    

  • sockdevs

    @mikeTheLiar said:

    Not a major :wtf:

    It's hand-rolled date-handling code; that's always a major :wtf: :stuck_out_tongue_winking_eye:



  • We all know TR :wtf: is VB6.



  • In parody of my IDE:

    :exclamation: dmcTwentyEight seems to be unused in this scope.



  • @mikeTheLiar said:

    dimFebruary = DaysInMonthCategory.dmcTwentyNine

    On average, it's wrong three times out of four!



  • I know what @groaner means, and it is still funny, so I am requesting a :barrier: to :pedants:



  • More like 3.03 times out of 4.


  • Discourse touched me in a no-no place

    @ben_lubar said:

    More like 3.03 times out of 4, you dumb shits.

    DYPFY.


  • Discourse touched me in a no-no place

    @Groaner said:

    @mikeTheLiar said:
    dimFebruary = DaysInMonthCategory.dmcTwentyNine

    On average, it's wrong three times out of four!

    And wrong for September 1752.



  • 11 leap days in a row?



  • Meh, not as bad as mixing \ and / in VB



  • What about calling / a "backslash" in English?



  • I'm just guessing here: But in a world dominated by right handed people, the "slash" is moving "away" from you, and if you gestured it, it would be a "backhanded" as in tennis. Thus making a forward slash open or fore handed one.



  • I think it's cultural thing - whichever you encounter more often, you think of it as the "correct" slash, and the other one is back-asswards.


  • Discourse touched me in a no-no place

    @Gaska said:

    I think it's cultural thing - whichever you encounter more often, you think of it as the "correct" slash, and the other one is back-asswards.

    Well, UNICODE (that bastion of good sense and reasonableness!!!!!) calls \ a “REVERSE SOLIDUS” and / a “SOLIDUS”. I don't plan on using the word “solidus” for those things any time soon, but I'm happy to take their word for what is backwards.



  • @dkf said:

    SOLIDUS

    NSFW thread is :arrow_double_down: :fa_arrow_circle_left: :recycle: that way.



  • More fun with terminology:

    backslash (redirected from Reverse solidus) n. A backward virgule ( \ ).


  • @Gaska said:

    virgule

    :giggity:



  • Has no one noticed the REAL problem here?

    @mikeTheLiar said:

    dimAugust = DaysInMonthCategory.dmcThirty


  • Impossible Mission - B

    It's to compensate for February. Now a year is on average the correct length



  • Could explain why the error was not noticed: because the bottom line was always correct come year end, and that's the only time anybody looks at the figures.



  • Why do you assume anyone actually reads it?



  • @Gaska said:

    Why do you assume anyone actually reads it?

    A little ambiguity here, probably because there may be some in my reply.

    Anyway, to answer:
    I was referring to any report that came out of what ever process that used the Code in the Article.

    If you mean "the Article" when you say "it", my response would be: Previously I did assume that it was read. However, recent anecdotal evidence would suggest that it is (systematically) not. Properly, anyway :laughing:



  • No, I meant the produced reports. Who would want to read those?


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.