• trwtf (unregistered)

    Awww... it's purty!

  • (cs)

    It's sort of like a modern art sculpture carved out of dried cow manure. It looks kind of pretty there in the museum, but at the end of the day, it's really just a big pile of sh*t.

  • Bill's Kid (unregistered)

    If I'm not mistaken, this is the "Statue" programming pattern often taught at Easter Island Institute of Technology.

  • baka0815 (unregistered)

    Am I the only one seeing a beautiful lady leaning on a wall?

  • George (unregistered)

    Under the spreading B11CFee, I soldU and you soldB. There we lie and there EscB, under the spreading R5Fee.

  • Gary (unregistered)

    It was an entry in the Obfuscated VBA contest. Which is why it is a slumping, flaccid mess.

  • (cs)

    I like how only the last variable on each line is given an actual type, the rest just empty/uninitialised variants.

  • szeryf (unregistered)

    ...and the algorithm for arranging the variable declarations in this way is NP-complete, mind you.

  • Jason (unregistered) in reply to baka0815

    Isn't it supposed to be a vase?

  • shotcircut (unregistered) in reply to Gary

    Isn't all VBA?

  • Another Anonymous (unregistered)

    So this is what they mean when they say programming is an art?

    (Also, this guy was obviously not paid per line.)

  • (cs)

    Poor Trent, may he rest in peace...

  • Migala (unregistered)

    ProsDirty1 StripTot FER FedFee EnID soldU StringID GRat1

  • (cs)

    Against the long spreading rumour that the universe is constantly expanding I have to tell you it is not.

    What we see here - wonderfully carved in VBA - is the plotted extension data starting from the Big Bang up until the present day.

    Time increasing top to bottom, size increasing left to right.

  • trwtf (unregistered) in reply to shotcircut
    Isn't it supposed to be a vase?
    shotcircut:
    Isn't all VBA?

    No, some VBA is supposed to be two faces. And some is supposed to be a duck, and some is supposed to be a rabbit.

  • (cs) in reply to trwtf
    trwtf:
    Isn't it supposed to be a vase?
    shotcircut:
    Isn't all VBA?

    No, some VBA is supposed to be two faces. And some is supposed to be a duck, and some is supposed to be a rabbit.

    No quack.

  • Iron fisted bit flipper (unregistered)

    This technique takes software craftsmanship to a whole new level.

  • Doozerboy (unregistered)

    My first programming gig was much the same.

    All the code in one module, took 15 minutes to open, all controls on the forms called checkbox12, checkbox15 etc etc. The front end alone was a mammoth 1/2 GB as the developer hadn't bothered to split his UI from his data.

    Fortunately i had a sympathetic boss who let me bin it and start again from scratch.

  • Doozerboy (unregistered) in reply to baka0815
    baka0815:
    Am I the only one seeing a beautiful lady leaning on a wall?

    If it is, she's only thinking about the money.

  • Trent (unregistered)

    God dang it...you are displaying my art sideways again!

  • (cs)

    It sort of resembles a 90-degree rotated graph of something. Perhaps of the developer's likelihood of leaving that company to work elsewhere?

    Also, good point Feng made about no Type on most variables! Obviously I've been writing far too much Delphi/Javascript lately! Maybe the guy only wrote Windows Script rather than VBA, and assumed 'they'll be the same...'?

  • Bobbo (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    No quack.

    I think somebody has already had plenty of quack.

  • (cs)
    The variables were often given incoherent and inconsistent names, and in many cases, vowels were dropped from names where they should have belonged. Maybe he felt that by not using vowels it would be a cost savings for the company Mike chuckled to himself

    Didn't anyone ever tell Mike? If you don't move your vowels, you get consonated.

  • My name (unregistered)

    Sort the lines by length, damnit!

    Public AT1 As Long
    Public GetB As Long
    Public PradPs As Long
    Public Geta1ID As Long
    Public StringID As Long
    Public ProformID As Long
    Public CreatedID1 As Long
    Public TickerTal1s As Long
    Public InvalidCount As Long
    Public PrmID, ImptID As Long
    Public EnID, InvaldID As Long
    Public RdID, RefundedID As Long
    Public OffWeightedSum As Currency
    Public B11CFee, PortFee As Currency
    Public RSDPctAr, FoldPct As Currency
    Public DS1, DS2, DS3, AS4 As Currency
    Public InvldMet, FER, AS1 As Currency
    Public RevUpPct, RvUpPost As Currency
    Public RV1, RV2, RV3, BSS4 As Currency
    Public FFF, NCF1, BB1, B1A As Currency
    Public EscA, EscB, InvaldT As Currency
    Public RSDFee, FedFee, R5Fee As Currency
    Public StripTot, StripTotalPct As Currency
    Public ValPrt, PretextVar, G1, R1 As Currency
    Public PartAff12, affixedMost, GRat1 As Currency
    Public ProsDirty1, ProcSpl, CartSplit1 As Currency
    Public PC5A, PC3A, PC4A, P3B1, PCU, PCR As Currency
    Public DC5, DC3, DgCA, DcM, DCB, DCU, DCR As Currency
    Public RftUpPct1, RftUpPosted1, RftUpPat2 As Currency
    Public rptAffordeD, raptCapped, rptPostand As Currency
    Public B5DP, B3DP, BMAP, BARP, BUPP, BREP1 As Currency
    Public GtQ5, GtQ3, GTQA, GTQM1, GTQB1, GQU As Currency
    Public Var1, Var2, Var3A, VarM1, VarU4, VAR As Currency
    Public Save2S, Save3A, Save4A, Save5A, Save12 As Currency
    Public Gubr2, GUBR1, GubrA, GubrB, GubrC, GubrU As Currency
    Public PercentB, Percent35U, PercentU, PercentR As Currency
    Public PercentF, PercentD, PercentRSD, PcentD1H As Currency
    Public Prod7Sum, ProdBBSum, ProdAM1Sum, ProdBSum As Currency
    Public PercentJS, PercentJ7, PercentJ5, PercentJ1 As Currency
    Public Disr1A, DISR3A, Disr5, DisrB, DiscrA, Disr6 As Currency
    Public ProdRLSum, ProdRSum, ProdRSDSum, ProdR06Sum As Currency
    Public ProdR, ProdM, ProdN, ProdFD, ProdRSD, ProdD1H As Currency
    Public ProdP, ProdPSum, ProdRSum, ProdTSum, ProdFSum As Currency
    Public Port1, Port3, PostA, PostB, Post2, Post3, PostD As Currency
    Public Prod2, Prod1, Prod3, ProdH, ProdE, ProdB, ProdQ As Currency
    Public PosandAllowd, PosandStopd, PortandDue, Serv1scart As Currency
    Public Port6Sum, Port9Sum, PortB4Sum, PortHSum, PortHSum As Currency
    Public soldG, Sold12, soldB, SoldX, SoldY, soldZ, sold44 As Currency
    Public Disc7Sum, Disc8Sum, DiscB4Sum, DiscUJSum, SaveWSum As Currency
    Public rptPrt4, rptPrt6, rptPrtJ1, rptPrtI, rptPortB, rptP As Currency
    Public soldU, soldPU, SoldH, SoldI, SoldJ, SoldN, SoldF, soldUP As Currency
    Public SoldRAS, SoldR11, SoldR12, SoldR13, SoldD1, SoldD2, SoldSP, SoldPC As Currency
  • Iie (unregistered) in reply to Bill's Kid
    Bill's Kid:
    If I'm not mistaken, this is the "Statue" programming pattern often taught at Easter Island Institute of Technology.

    Hit CTRL+A and it will shoot lasers out its eyes.

  • TheSHEEEP (unregistered)

    "Gubr2, GUBR1, GubrA, GubrB, GubrC, GubrU"

    Hey, that's Obelix! Gubr Gubr Gubr Gubr!

  • (cs)

    Actually, this is beautiful from a maintenance perspective. Now Mike has a list of all of the global variables to use in his find-and-replace.

  • TheSHEEEP (unregistered)

    "Gubr2, GUBR1, GubrA, GubrB, GubrC, GubrU"

    Hey, that's Obelix!

  • Vilx- (unregistered)

    It's like a christmas tree!

  • blah (unregistered) in reply to pinkduck
    pinkduck:
    I like how only the last variable on each line is given an actual type, the rest just empty/uninitialised variants.

    Really? Yuck. So glad I've had so little exposure to VB/VBA.

  • (cs) in reply to baka0815

    Does anyone remember a poster from a computer software company in the mid-1980's where the backdrop looked like a "misty mountain range", but upon closer examination was a reclining naked woman????

    If anyone knows of a reproduction (or even better has an original!!!) please contact me directly.

  • (cs) in reply to Cad Delworth
    Cad Delworth:
    It sort of resembles a 90-degree rotated graph of something. Perhaps of the developer's likelihood of leaving that company to work elsewhere?
    I was going to suggest the same thing; it's the developer's intent to resign as a function of time. That makes me wonder what the valleys (around InvldMet, RftUpPct1, and PercentB) must mean. Maybe they represent weekends?
  • (cs) in reply to blah
    blah:
    pinkduck:
    I like how only the last variable on each line is given an actual type, the rest just empty/uninitialised variants.
    Really? Yuck. So glad I've had so little exposure to VB/VBA.
    Wow. I've had way too much exposure to VBA, and I was not aware of that. (Although I'm pretty sure that I've always declared one variable per line, so it wouldn't have come up in my code.) But I checked the documentation, and blah is absolutely right--the VBA compiler really does interpret those declarations that way. You need to put an 'As Long' or whatever after each variable name--as this code is written, most of the variables are untyped variants.

    But I suppose explicitly writing all of the declarations would have interrupted the aesthetic flow of the code.

  • (cs) in reply to SCSimmons

    Someone help me out here, I can't find Waldo.

  • Grumpy (unregistered) in reply to baka0815
    baka0815:
    Am I the only one seeing a beautiful lady leaning on a wall?
    Yes. Yes, you are. Please get adult supervision.
  • (cs) in reply to baka0815
    baka0815:
    Am I the only one seeing a beautiful lady leaning on a wall?

    All I see is a haggard old lady.

  • trwtf (unregistered) in reply to frits
    frits:
    baka0815:
    Am I the only one seeing a beautiful lady leaning on a wall?

    All I see is a haggard old lady.

    I don't see what Merle Haggard's old lady has to do with any of this.

  • Lewis (unregistered)

    Twas brillig, and the soldZ TickerTal1s, Did Geta1ID and GubrU in the wabe: All Post3 were the PosandAllowd, And the RftUpPat2 GubrA

  • Anonymous (unregistered)

    now reformatting my current project source code

  • Anonymous (unregistered)

    I always try to arrange variable declarations by line length. We're talking about a handful of function-level declarations rather than a stinking mess of globals, but I always find myself putting them into some kind of natural order and it's normally by length (sometimes alphabetical if that looks more asthetically pleasing). It's not a code thing since every book I own is arranged in height order as well. If I washed a bit more often I would highly suspect OCD but as it stands I'm probably just time-wasting.

  • Mike (unregistered)

    It's all about using the right tool for the job. In this case, they used a lathe.

  • Patrick (unregistered)

    It looks like Rageface side-on

  • The Configurator (unregistered)

    More like a fright calculator...

  • (cs) in reply to SCSimmons
    SCSimmons:
    blah:
    pinkduck:
    I like how only the last variable on each line is given an actual type, the rest just empty/uninitialised variants.
    Really? Yuck. So glad I've had so little exposure to VB/VBA.
    Wow. I've had way too much exposure to VBA, and I was not aware of that. (Although I'm pretty sure that I've always declared one variable per line, so it wouldn't have come up in my code.) But I checked the documentation, and blah is absolutely right--the VBA compiler really does interpret those declarations that way. You need to put an 'As Long' or whatever after each variable name--as this code is written, most of the variables are untyped variants.

    But I suppose explicitly writing all of the declarations would have interrupted the aesthetic flow of the code.

    Interestingly, the declarations would work properly in VB.Net. Usually people who make these atrocoties are way behind in technology, but this guy seems to be ahead of himself.

  • Jay (unregistered) in reply to Anonymous
    Anonymous:
    I always try to arrange variable declarations by line length. ... I would highly suspect OCD but as it stands I'm probably just time-wasting.

    You mean CDO. You should put the letters in alphabetical order like they belong.

  • NutDriverLefty (unregistered) in reply to boog
    boog:
    Now Mike has a list of all of the global variables to use in his find-and-replace.

    I bet he doesn't!

  • Jay (unregistered)

    I can see how this program would be difficult to maintain. Every time you create a new variable, not only do you have to come up with a name that concisely expresses the semantic purpose of the variable within the program, but you also have to make sure that the length of the name will fit properly with the aesthetic layout of the declaration list.

  • Dr.Evil (unregistered)

    I see it, it's a sailboat!

  • (cs)

    Now we know how the Easter Island statues came to be...an ancient alien civilization programming in VB noticed this beautiful pattern in their global variables and decided to memorialize them in stone.

  • (cs)

    Actually, this could be a fun project, especially if it looks like you will be stuck with maintaining the Freight Calculator for the rest of your time at this company.

    The goal would be to gradually eliminate as many global variables as possible, by replacing them with parameters that are passed from one function to the next (assuming this system has more than one function).

    Start by picking a variable, seeing where it is used, then declare it as a local at the highest level of the stack, and change the function call(s) to pass it as an argument to the functions.

    Little by little, you will transform the globals into locals, creating order and beauty in this labyrinth. Imagine the satisfaction and sense of accomplishment. In the process you will develop an understanding of the app, and add documentation throughout the code. Discover the beauty in the humblest of things.

Leave a comment on “Feng Shui”

Log In or post as a guest

Replying to comment #:

« Return to Article