Comment On Enterprise Level Access

Some time ago Martin F. was sent in by his IT consulting company to help fix some problems with the HR Database at a major European banking / insurance firm.  He admits that the WTF worthy warning signs were there at the onset (among them being that he was the 4th in a series of consultants assigned to this project), but being relatively naive to such things, he accepted the position and spent a year shaking his head in bewilderment and, at the same time, his fists at Rob.  He was an HR 'specialist' and a true IT genius who had a self-proclaimed hobby of programming in Visual Basic and was, of course, long gone from the corporation. The HR Access-pool [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: Enterprise Level Access

2009-01-05 09:13 • by JM (unregistered)
This comment is empty.

Re: Enterprise Level Access

2009-01-05 09:22 • by PJ (unregistered)
Real WTF is Using Access and excel for such a large data (50,000 people's record)

Re: Enterprise Level Access

2009-01-05 09:23 • by DOA
You know, you could have stopped this story at the end of the second paragraph and it would still be front page material.

Sorry, I couldn't resist...

2009-01-05 09:33 • by Rockafellow (unregistered)
...about all the (over 50,000) employees...


Wow, that's OVER 9,000!

Re: Enterprise Level Access

2009-01-05 09:34 • by Capt. Oblivious (unregistered)
I saw code this bad on slashdot yesterday.

http://slashdot.org/comments.pl?sid=1080033&cid=26325951

captcha: abigo(ne)?

Re: Enterprise Level Access

2009-01-05 09:34 • by Osno (unregistered)
I love the way he cleans up the variables after using them. That's just cute.

Python

2009-01-05 09:51 • by Wyrd (unregistered)
The Real Problem with, well basically *all*, computer programming is that the set of ways that you can do it wrong is far greater of the set of ways to do it right.

Except I'm not sure if that applies to Python. I haven't used it myself. I know it's possible to do wtf's in it if you actually try, but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?

--
Furry cows moo and decompress.

Re: Enterprise Level Access

2009-01-05 10:12 • by Sprite_tm (unregistered)
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

Re: Enterprise Level Access

2009-01-05 10:17 • by ubersoldat
My doctor told me to stay away from VB stuff... Actually, he told me to stay away from shit, because I'm allergic or something. Anyway, any one kind enough to dissect all that Microsoftish gibberish?

Re: Enterprise Level Access

2009-01-05 10:24 • by Rockafellow (unregistered)
237367 in reply to 237365
Sprite_tm:
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

The variable name is not the WTF. The WTF is the clunky, unwieldy, implementation that includes redundant operations. Much easier would have been to declare a range and then:
RangeIsEmpty = (WorksheetFunction.CountA(SourceRange) = 0)

Courtesy ewbi.develops via Google.

Re: Enterprise Level Access

2009-01-05 10:25 • by configurator (unregistered)

private bool Row_Is_Empty(long iRowNr, object lLastCol, Worksheet sh)
{
bool tempRow_Is_Empty = false;
int j = 0;
bool is_empty = false;
int teller = 0;
teller = 0;
string curr_cell = null;

for (j = 1; j <= lLastCol; j++)
{
curr_cell = sh.Cells(iRowNr, j).@value.Replace("\n", "").Trim(' ');
if (curr_cell != Microsoft.VisualBasic.Constants.vbNullString)
{
teller = teller + 1;
}
else
{
teller = teller;
}
}

if (teller == 0)
{
is_empty = true;
}
else
{
is_empty = false;
}

teller = 0;
if (is_empty == true)
{
tempRow_Is_Empty = is_empty;
}
else
{
tempRow_Is_Empty = false;
}
is_empty = false;
teller = 0;
return tempRow_Is_Empty;
}


Autocoverted with a tool

Re: Enterprise Level Access

2009-01-05 10:28 • by Cantabrigian
237369 in reply to 237362
Osno:
I love the way he cleans up the variables after using them. That's just cute.


Especially the way he sets teller = 0 twice - just to make absolutely sure...

Re: Enterprise Level Access

2009-01-05 10:29 • by Anon (unregistered)
237370 in reply to 237368
configurator:
[code]
Autocoverted with a tool


Actually, I think the original was written by a tool!

I always like to make sure when I'm checking if something is empty and find something, to keep checking just in case.

Re: Python

2009-01-05 10:31 • by Anon (unregistered)
237371 in reply to 237364
Wyrd:
I know it's possible to do wtf's in it if you actually try, but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?


I've not used Python either, but usually anything that makes coding "easier" makes producing bad code "easier" too!

(see also: Visual Basic).

Re: Enterprise Level Access

2009-01-05 10:31 • by mbv (unregistered)
237372 in reply to 237367
Rockafellow:
Sprite_tm:
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

The variable name is not the WTF. The WTF is the clunky, unwieldy, implementation that includes redundant operations. Much easier would have been to declare a range and then:
RangeIsEmpty = (WorksheetFunction.CountA(SourceRange) = 0)

Courtesy ewbi.develops via Google.

Well, it limits the number of companies that can be mentioned here to 5, and I've heard a similar story for a Dutch bank. They used Access for a database, which grew too big, so performance got rather slow. Someone I know was involved in their upgrade to some standard software (probably SAP).

Re: Python

2009-01-05 10:33 • by Josh (unregistered)
237373 in reply to 237364
Wyrd:
...but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?


You know, that's one thing I've never seen: a Python WTF. Anyone care to share? I'd pony up a $10 reward for Python WTF's but I'm too cheap.

Re: Enterprise Level Access

2009-01-05 10:38 • by Mcoder
237375 in reply to 237362
Osno:
I love the way he cleans up the variables after using them. That's just cute.

Yeah, I love the way he cleans INTEGER variables too...

@ubersoldat
The function verify if there is any null field at a given row of a recordset. It also catches white space, I don't know if it is by design.

It is implemented this way: It converts the recordset into a worksheet (don't know if it consumes time, but it is Microsoft, so probably does), access all the strings on the wanted row of the worksheet and count the number of times the empty string appears.

Then, if the counter is zero, set a flag. Following, it goes into the well known pattern if(boolean = true) then another_boolean = true else another_boolean=false and returns another_boolean.

Of course, during that time, he goes out of the way to flag the compiler that it can free an integer variable it (didn't) allocated, and may have commited a hole lot of sins that I can't see because I'm not a VB developer.

Re: Python

2009-01-05 10:48 • by Bob (unregistered)
237377 in reply to 237373
Looks like a neat python WTF:
http://www.pirnat.com/mike/2008/11/25/python-youre-doing-it-wrong/

Re: Enterprise Level Access

2009-01-05 10:50 • by greg (unregistered)
The only way it's _completely_ wrong is if there is an API function to check a row if it is empty. Is there?

Re: Python

2009-01-05 10:51 • by SomeCoder (unregistered)
237379 in reply to 237373
Josh:
Wyrd:
...but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?


You know, that's one thing I've never seen: a Python WTF. Anyone care to share? I'd pony up a $10 reward for Python WTF's but I'm too cheap.



Hmmm.. too bad I don't still have access to the monstrosity that was the Python script I had to deal with at one of my previous employers. It was one of those self aware scripts that rewrote pieces of itself to ensure that it was always running the latest version... or something. Not sure I ever found out the real reason for it.

Anyway, the thing was about 15,000 lines long to do something that could have been done in maybe a 500 line Perl script. Hell, maybe even 500 lines in Python if the original programmer had not insisted on being so "clever" and using a lot of unnecessary Python tricks in his code. Basically it was way over engineered.

Don't tell me you can't write WTFs in Python. You can write WTFs in any language. :)

Re: Enterprise Level Access

2009-01-05 10:53 • by Waffle (unregistered)
Well, I'm the submitter of this ... thing, and yea it's really as bad as it sounds.

The Real WTF (tm) is of course that their central HR repository was managed through Excel and Access by people who were, well... HR professionals.
Behind that was naturally a very slow and rigid IT service that basically sent them to hell when they saw their requirements (some silly ones, some quite reasonable ones) for the database. Therefore, "Rob" figured it would be easier to keep full control while at the same time giving him the occasion to practice his guru-skillz.

I doubt that the codebase was Tool-generated... and through various methods in the many related tools, I could see Rob had learnt new (and sometimes hilarious) programming techniques and tested them on "this and that piece o' software".

This couldn't be complete without the fact that the people running this terrible process actually found it decent and were reticent to changing it because, well... the guy who had designed it was an IT wizard, after all.

For those wondering, it was a Belgo-Dutch bankinsurer (notice the use of the past tense).

Re: Python

2009-01-05 10:55 • by audax (unregistered)
237381 in reply to 237373
http://forums.thedailywtf.com/forums/t/7522.aspx
http://forums.thedailywtf.com/forums/p/8806/166686.aspx#166686
http://forums.thedailywtf.com/forums/p/10340/183784.aspx#183784

Just to name a few...

Re: Python

2009-01-05 11:02 • by anonymous_coder() (unregistered)
237382 in reply to 237373
Josh:
Wyrd:
...but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?


You know, that's one thing I've never seen: a Python WTF. Anyone care to share? I'd pony up a $10 reward for Python WTF's but I'm too cheap.


Dig into some of the older parts of Plone, and you can find some WTFs. Not "I'm too stupid to be a programmer" type, but "There are three people on earth who understand what this chunk of code does, and you aren't one of them" type WTFs. Implementing Java-style interfaces in Python. XML used to configure those interfaces. Two completely different templating languages. And an ACL-based security model that defines complex.

It takes a long time to build up enough knowledge to become proficient in Plone...

Re: Enterprise Level Access

2009-01-05 11:04 • by Morry (unregistered)
NOT a WTF. This is a good thing. Anything that keeps HR from screwing things up is a good thing.

Re: Python

2009-01-05 11:04 • by DaveK
237384 in reply to 237373
Josh:
Wyrd:
...but the hype always said that Python makes programming easy, so maybe it's harder to *accidentally* produce bad code in it?


You know, that's one thing I've never seen: a Python WTF. Anyone care to share? I'd pony up a $10 reward for Python WTF's but I'm too cheap.
Python WTFs? No problem. Try figuring out where the control flow is supposed to go in a bunch of nested IFs when some @#!$% has gone and mixed TABs with spaces for indentation!

I had another one that I can't quite remember the details of now, something to do with shifting an integer left and it suddenly turning into a long int and either a) not turning negative as I had expected when I OR'd in 0x80000000, and/or b) throwing an exception when I tried to mask it by ANDing with an integer value. Don't quite remember the exact details any more, but it was a WTF moment for me when I finally figured out that the type of the result of an operator could vary according to the particular integer values it was applied to.

Re: Enterprise Level Access

2009-01-05 11:05 • by Morry (unregistered)
(screwing things up for the employee)

Re: Enterprise Level Access

2009-01-05 11:06 • by Procedural (unregistered)
One thing that annoys me with the way the story is told is this: obviously this is an old institution. Some guy (Rob) has the foresight to replace what must have taken a whole cadre of employees a large chunk of time to do manually or on outdated equipment and makes it so that it can be done with comparatively minimal staff. He's no programmer (he says that doing VB is a hobby), he's an HR guy with competencies beyond those of the typical HR person. Good for him. Great for the company too.

The system works better than the older one but is still suboptimal and does not scale. So they hire a consultant to make it snappy, and that pompous ass shows up, laughs at what was done, dumps on the other guy, and fails to realize that the problem is relatively small: if Rob hadn't been there, it wouldn't be one consultant showing up to fix it; it would have been a whole team. So a non-programmer doesn't know how to return a boolean in the most effective way ? So freaking what. He probably saved his employer a lot more than the wages he ever took in (and was probably not paid that much more about the baseline HR salary to come up with that).

Ten years from now, some schmo will show up thinking he is God's gift to computing sciences, and will see that whoever was that idiotic consultant, he made a few mistakes: he designed stuff that obviously wouldn't scale well on quantum processors (the idiot !), relies on MS SQL (which by now is an embeddable component barely good enough to hold the temperature history in my thermostat), and did ridiculous code that relied on procedural programming rather than intentional declarations (what a twit ! And they paid that guy money !).

The funny part of the story is that consultant's deficient thought processes.

Re: Enterprise Level Access

2009-01-05 11:10 • by Steenbergh (unregistered)
I know who you mean. I'm there now. Herman and Thom say Hi.
I'm maintaining an ASP-based self-service HR application older than me. I could start my own WTF website with the crap I find here...

Re: Enterprise Level Access

2009-01-05 11:10 • by Procedural (unregistered)
237389 in reply to 237386
"about the baseline HR" => "above the baseline HR"

Re: Enterprise Level Access

2009-01-05 11:13 • by Procedural (unregistered)
237390 in reply to 237368
Converting it to C-sharp is not a significant improvement.

Re: Sorry, I couldn't resist...

2009-01-05 11:17 • by I walked the dinosaur (unregistered)
237391 in reply to 237360
What??? Over 9000?

Re: Enterprise Level Access

2009-01-05 11:24 • by convicted felon (unregistered)
By the end of that show, they're into the millions. Super Saiyans for the win.

Re: Python

2009-01-05 11:27 • by Bobble (unregistered)
237393 in reply to 237364
There are many other trades/industries that come to mind that are the same way - off the top of my head: Construction, Law Enforcement, Food Service.

Come to think of it, every industry is like this.

Re: Enterprise Level Access

2009-01-05 11:29 • by MisterCheese (unregistered)
237394 in reply to 237390
Thought it was C-pound?

Re: Enterprise Level Access

2009-01-05 11:30 • by AnonCoward23 (unregistered)
237395 in reply to 237365
Sprite_tm:
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

Or maybe he's German. German 'teller' is English 'plate'. :)

Re: Enterprise Level Access

2009-01-05 11:58 • by Wongo (unregistered)
In American, Teller = !Penn. Five of clubs anyone ?

Re: Enterprise Level Access

2009-01-05 12:10 • by lolwtf
237399 in reply to 237394
It's C-Tic-Tac-Toe.

Also:
"every month...
This song and dance took 2 people a week to accomplish. [...] then go to step 1 and repeat the process for the "final" version."
You call it a WTF, I call it job security.

Re: Enterprise Level Access

2009-01-05 12:22 • by hamBone
I am far from a VB guru, but what in the name of binary is the teller=teller line about?

Re: Enterprise Level Access

2009-01-05 12:23 • by halcyon1234
237401 in reply to 237399
Doing automated checks manually may take up 2 manweeks, but it saves a lot of cycles on the CPUmatron. Those things are VALUABLE!

Re: Enterprise Level Access

2009-01-05 12:24 • by Daniel (unregistered)
This hurt my eyes.

God, you could pick any paragraph after the first, and it would still be a WTF.

Re: Enterprise Level Access

2009-01-05 12:27 • by Been there done that (unregistered)
These situations invariably develop as a result of business needs being ignored by a stale or incompetent IT department leaving guys like "Rob down in HR" to solve the problem on his own, perhaps inelegantly, but solved nonetheless.

Re: Enterprise Level Access

2009-01-05 12:31 • by Anon (unregistered)
237404 in reply to 237383
Morry:
NOT a WTF. This is a good thing. Anything that keeps HR from screwing things up is a good thing.


Good point. If HR weren't busy dealing with this crap, who knows what kind of hijinks they'd be up to.

Re: Enterprise Level Access

2009-01-05 12:37 • by ElPolloDiablo (unregistered)
237406 in reply to 237380
Waffle:
Well, I'm the submitter of this ... thing, and yea it's really as bad as it sounds.

...

For those wondering, it was a Belgo-Dutch bankinsurer (notice the use of the past tense).


Hmmm, does the name start with an F ? Would explain a lot tho if that's the case...

In any case, welcome to the wonderful world of financial instution's software, I always say.

Re: Enterprise Level Access

2009-01-05 12:41 • by Voodoo Coder
237408 in reply to 237378
greg:
The only way it's _completely_ wrong is if there is an API function to check a row if it is empty. Is there?


I haven't written VBA since my early, pre-professional days...but I know that there are several ways to accomplish what this does, without being a complete knucklehead. Here's a 3 line solution that checks the first row:

If WorksheetFunction.CountA(Range("1:1")) = 0 Then

rowIsEmpty = True

End If


You can break it down from there, and see that it wouldn't be rocket science to throw the entire sheet into it. You can also use things like xlUp and xlDown to determine the start and end of content.

Or, you can abandon VBA for any solution beyond making simple for-your-use-only macros.

Re: Enterprise Level Access

2009-01-05 12:43 • by Bobbo (unregistered)
237409 in reply to 237395
AnonCoward23:
Sprite_tm:
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

Or maybe he's German. German 'teller' is English 'plate'. :)


Or maybe he was a fan of Penn and Teller?

Re: Enterprise Level Access

2009-01-05 12:45 • by Bobbo (unregistered)
237410 in reply to 237409
Bobbo:
AnonCoward23:
Sprite_tm:
Perhaps the guy is Dutch? Dutch 'teller' is English 'counter'.

Or maybe he's German. German 'teller' is English 'plate'. :)


Or maybe he was a fan of Penn and Teller?


Whoops, I've just noticed this has been done. That'll teach me to nip to the shops before replying to the 'last' post without refreshing!

Re: Enterprise Level Access

2009-01-05 12:53 • by Tom (unregistered)
237412 in reply to 237400
hamBone:
I am far from a VB guru, but what in the name of binary is the teller=teller line about?

It was running on a symmetrical multiprocessor. You need the same number of instructions on both branches of an "if" statement, to maintain symmetry.

Re: Enterprise Level Access

2009-01-05 13:00 • by wintermute (unregistered)
237413 in reply to 237394
MisterCheese:
Thought it was C-pound?

C£?

That makes no sense.

Re: Enterprise Level Access

2009-01-05 13:29 • by weirded verber (unregistered)
yes... c-pound.
I like C-Pound for the error handling

Re: Enterprise Level Access

2009-01-05 13:36 • by Code Dependent
237416 in reply to 237408
Voodoo Coder:
Here's a 3 line solution that checks the first row:

If WorksheetFunction.CountA(Range("1:1")) = 0 Then

rowIsEmpty = True

End If
Why even bother with the If statement?

rowIsEmpty = (WorksheetFunction.CountA(Range("1:1")) = 0)
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment