- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Print the frist page? No
Admin
Never, never, never, make an observation like this in front of the customer.
Seriously. Never do that. I know we all say things we shouldn't. But try to say them back in the office. At the very least, you can offer Boris the New, Enhanced, version of the software that does this trivial thing for a mere $5000 more.
Admin
VB had check boxes in the 90s, didn't it? Yes, I'm pretty sure it did.
Admin
@Mr. TA
Surely you're not suggesting they query to determine the maximum page number then generate a wall (or better yet a tower) of checkboxes labeled Page 1, Page 2, Page 3, ..., Page n.
Don't laugh; I've seen it (or the moral equivalent) done.
Admin
Since you're re-querying each time, when the dataset changes and a record expected on page n gets bumped to page n+1, you get a ticket where you have to explain to the customer "don't change the data".
Admin
Yeah that tower would look terrible. The article mentions page 73, it would be a tall tower.
Still, VB had text boxes in the late 90s, didn't it?
Admin
That's not really the point, is it?
If the customer requirement was "We want to step through the pages until we get to the right one," you can explain all you like that it's easier to use a text box, and some numpty will tell you that the requirement is the requirement.
The main issue here is the select statement, which is dragging the whole table over, on every query. Assuming you can't get the page id out of the table, use a temporary table augmented with the page id, or possibly a cursor (preferably on the client side).
It's all very well to ask the user to input the number of the page they want, but perhaps they don't know until they see the text. Picking some arbitrary index from 1 to 72 is not necessarily very helpful.
Admin
Yep, definitely a rookie mistake, which I've made on more than one occasion. A good reason to keep a degree of separation between your developers and your customers. We technically-minded folk aren't always known for tact.
Admin
My reading of the article suggests that isn't the customer's requirement. The requirement is actually to be able to just print one page of the report. The UI would be a WTF even if it wasn't backed by a really bad implementation.
Admin
There was no indication that it showed every page and asked the user whether to print it or not.
Admin
Actually, the reverse is worse, where it is expected on page N, but when you flip from N-1 to N, you find that someone else did something that moved it to N-1, so you don't find it.
Admin
One of the worst problems with "print these page numbers" is that the page numbers used don't necessarily correlate with the page numbers printed on the page due to various bits and pieces of prefacing material.
Admin
"(or better yet a tower)"
No, definitely a wall. Then make the customer pay for it. Better yet, make Mexico pay for it.
Admin
WT..., WT..., WTF !!!!
Yeah, let's use the end-user as the cannon-fodder in a war between management and project "leaders." I cannot count how many times I have saved an operator mindless clicking each day until the end of the shift with the use of one or two lines of code.
Project leader doesn't want to do the work until they can bill through the nose. Management doesn't want to pay for some trivial work.
Best to find the holes in the specification and implement these features during commissioning, and keep it low-profile. I've seen too much s*** like this to not always side with the operator / end-user.
Admin
First WTF is breaking ranks in front of the customer. Do it once you're outside or do some diplomatic phrasing, but implying the application is crap and the person who wrote it is an idiot?
Then we need to dig through the original request - as it's pointed out they may have been given the option of check boxes or a text box to decide in advance what pages they want, but there's also the possibility that the pages you want are determined by other pages, so you look at say #5 and because of the values you want to look at 10-15, but you'd not know if you'd preselected them.
And yes, the redoing the select each time appears to be a waste, but without knowing how the systems operated at the time I can't say if it really was.
Admin
TRWTF is printing hardcopy in the first place. The correct UI should display something like: "Select page to print" [ entry box] "You really want to print? {yes,no} [radio buttons] "No, you do NOT want to print, and I won't let you."
Admin
So, so true. Even if the "customer" is internal/teammate/best work buddy.
I was asked to help automate some manual tasks in another department in my division. I watched them do the task, which took about 20 minutes per "thing" with about 10 "things" per day. My brain was screaming that a simple macro could save them an hour a day but I remained quiet and nodded my head. After the review I simply said, "I see some areas where I can help." Just saying that made them happy. After about six weeks of developing some automation, I was able to reduce the process from 20 minutes to 5. To quote Scotty, "how else are they going to think you are a miracle worker?"
Admin
What the customer wants never ceases to amaze me. Back around 1990, I was programming for someone moving legal documents to CD-ROM. Inexplicably, he wanted September abbreviated SEPT and all the other months their normal 3-character abbreviation. No logic could shake him from wanting the odd exception.
By the same token, there's no predicting the horrors programmers can bring to the table. On that very same project, they needed text substitution for common OCR errors, like "California" was often mis-scanned as "Califomia." My predecessor wrote a utility to do text substitutions... in x86 assembler. I refused to maintain it and re-wrote it in C. The C version was nearly 100 times faster. God only knows why the asm version was slower... as I was unwilling to figure that one out for myself.
Admin
The thing you really have to appreciate about Mark is how low of a bar he set for success. We should be thanking him. Now, every solution fixes the impossible, and that makes you, brave adventurer, the hero of every story at WTF inc.
Admin
Oh boy! War Stories! ... I took over an existing SQL/MS Word report. From the customer I learned a) this report goes to the top management and b) sub-level data was not in the report. The customer accepted this limitation, resigned to my Predecessor's explanation. I, having learned that most of Predecessor's code problems was PEBCAK, took a deep breath and opened the query. About 7 (printed) pages of SQL to fetch a 3 table 1:M relation chain. Each "item's" data was being concatenated as a single record with matching labels for every data-field as seen on the to-be-generated MS word document. As every stringified record exceeded the DB single-record length limit, Predecessor had removed 3rd table data fetch altogether. The replacement query fetching all data was literally 99% smaller with MS Word API handling headings, labels, and pagination.
Admin
No end to war stories. And I still have yet to decide if the technical horror stories are better or worse than the management horrors (like my submission on Monday). People speak of certification to prevent idiots from being in the wild, but you'd think a college degree and a couple years of experience would be equivalent. If it is, it's a sorry equivalent. Back in the mid 80's, I was working with a guy my age who had a bug in some code. He handed me 2 pages of C code. I asked "what's it do?" He starts explaining line by line and I stopped him. "In 20 words or less, what does this DO?" It converted a string date to 3 integers. TWO PAGES! I asked if the string was arleady vetted. That is in MM/DD/YY format. It was. I scribbled in the margin "sscanf( text, "%d/%d/%d", &month, &day, &year);' and told him to replace it all with that. I guess the part that amazed me most is that he was amazed that it worked. Sadly, I was his age so I couldn't ask the curmudgeonly question "what are they teaching in schools these days?"
Admin
@ Argle ... Yeah; as "languages" have evolved from syntax and verbs to complete APIs, somehow training for programmers has not kept up. If you don't know most of the built-in classes of your chosen framework or API, you're not competent.
e.g. .Net Framework / .NET Core includes umpteen thousand public classes intended for end-developer use. One cannot be a competent VB.Net or C#.Net programmer unless one can recognize most of them and know when to use them instead of rolling one's own.
Admin
Speak sincerely and be as secure in business as you do in your home. Make sure that person is cordial and nice and competent and diplomatic.
Best move: open up VizStudio 6 right there. Fix it. Install the new version. And don't say one word.
Admin
...HOW? Even if you don't know about sscanf (which I don't because I don't work with C), HOW do you make parsing a date like that anything longer than about one 10-line loop stepping through the characters of the string, doing "number += charToDigit() * positionMultiplier; positionMultiplier *= 10;" ?
Admin
"implying the application is crap and the person who wrote it is an idiot?" - Over the years I have told clients that an application was crap and the person who wrote it was performing like an idiot --- of course, in these cases, I was the person who actually wrote it (and owned the company that produced the application)
Admin
I used to think this was confined to programmers... until I found a story about plumber hired to fix something. He declared the previous plumber to be an idiot who did shoddy work. Turns out, of course, that he was the previous plumber.
Admin
" Back in the mid 80's ... MM/DD/YY" Ah, the 80s, when we all expected to die in a flash of light long before the millennium.
Admin
A friendly reminder: "Look I already told you, I deal with the -beep- customers so the engineers don't have to. I have people skills! I am good at dealing with people, can't you understand that? WHAT THE HELL IS WRONG WITH YOU PEOPLE?!" - Tom Smykowski: Office Space. Now jump to your own conclusion.