Comment On Fred Blogs' MegaQuit()

A few years ago, Gregory was about to start development on a quoting system, when the client pulled-out all of a sudden. “We appreciate all the work you put in so far,” they told him, “but your overall estimate was just too much; we were able to find someone else who could develop this for less than a third of your cost.” [expand full text]
« PrevPage 1 | Page 2Next »

Re: Fred Blogs' MegaQuit()

2010-04-05 14:59 • by justsomedude (unregistered)
304624 in reply to 304607
London Contractor:
Ross:
MegaQuit isn't so bad. Here's two things I can find wrong, but they're not really WTFs.

First, MegaQuit does two things when it should only do one. One is that it closes all forms; the other is that it asks whether it should quit access, and does so if confirmed. These should be two separate functions.

The second thing is related. If you're going to quit, why bother closing forms first? And if you do need to close forms before quitting, shouldn't you get confirmation before you start closing them?


I think in Access you need to manually close all the forms before you can quit - also they could be bound to the database, so you'd need to save any changes as well.

All the code sucks. Awful.


That is incorrect. All it takes is "Application.Quit", doesn't matter if forms are open.

Re: Fred Blogs' MegaQuit()

2010-04-05 15:11 • by Hatterson (unregistered)
304625 in reply to 304623
Hexadecima:
BBT:
So, for HoldIt...
If you call it in the 59th second of the minute, it's guaranteed to infinitely loop. If you call it with "longish" >= 59, it is guaranteed to infinitely loop. If you call it with "longish" greater than or equal to 59 minus the current second, it will infinitely loop.

That's one brillant function.


ACTUALLY, HoldIt() would only loop for a minute, not infinitely. Seriously you guys. Seriously.


Uhh what?

Second() returns a integer from 0-59 representing the current second.

startof will be set to 0-59 when the function is called.

Second(now) in the loop will return 0-59 meaning that if startof + longish >= 59 then temp will never be > longish and it will keep looping

second(12:00:01) - second(12:01:01) returns 0, not 60

Re: Fred Blogs' MegaQuit()

2010-04-05 15:13 • by HeWhoComesBackToHauntYou (unregistered)
The real reason why it was slow is because they were using Access, they should have used APDB.

Re: Fred Blogs' MegaQuit()

2010-04-05 15:17 • by Sig (unregistered)
Interesting... this appears to be one of the more non-wtf clients in the end.
Why? Since they called back the guy who they hired first, obviously because of the expertise... and showing more common sense then I've had the chance of seeing.

Re: Fred Blogs' MegaQuit()

2010-04-05 15:55 • by dkf
304629 in reply to 304622
Fred Blogs:
Let's just say we don't hire the brightest users at my father-in-law's company. He's widely known as a tightwad and won't hire anyone for more than minimum wage. Then he forbids outside food and drink, and puts in his own vending machines with $2.00 sodas and $7.50 sandwiches. So ultimately the only people who will work here are those who can't do any math. Hell, they can barely count. And read? Forgetaboudit.
Sounds like you already know enough to be able to run a business better than he can. Ever thought about starting up a competitor, filching all his customers and crushing his firm like a bug? It'd do both you and him a lot of good, and he'd respect you far more afterwards. (OK, he might hate you too, but respect... sure.)

Re: Fred Blogs' MegaQuit()

2010-04-05 16:54 • by Darkstar (unregistered)
304630 in reply to 304582
If you call it in the 59th second of the minute, it's guaranteed to infinitely loop. If you call it with "longish" >= 59, it is guaranteed to infinitely loop. If you call it with "longish" greater than or equal to 59 minus the current second, it will infinitely loop.

Well... if you call it with 59, it will just wait until the next leap second, given that Microsoft got their code right. (Yes, 23:59:60 is indeed a valid time expression - go rewrite your regexes, folks.)

Re: Fred Blogs' MegaQuit()

2010-04-05 17:04 • by Anonymous (unregistered)
"pulled-out" should be "pulled out". It's a verb followed by an adverb (like "log in" or "set up" or "frame up"), not a phrase acting as a noun (like "log-in or "setup" or "frame-up").

Re: Fred Blogs' MegaQuit()

2010-04-05 17:10 • by chewbacha
304632 in reply to 304631
Anonymous:
"pulled-out" should be "pulled out". It's a verb followed by an adverb (like "log in" or "set up" or "frame up"), not a phrase acting as a noun (like "log-in or "setup" or "frame-up").


Known well to "Anonymous" since conception.

Re: Fred Blogs' MegaQuit()

2010-04-05 18:34 • by mike (unregistered)
304634 in reply to 304618
rfoxmich:
WTF/KLOC is the standard measure. Problem is that number is usually >> 1


Divided by 2?

Re: Fred Blogs' MegaQuit()

2010-04-05 18:45 • by Chutney (unregistered)
So, do you think Fred was fired, or MegaQuit?

Re: Fred Blogs' MegaQuit()

2010-04-05 19:13 • by Aussie Contractor (unregistered)
304637 in reply to 304572
highphilosopher:
.... an Access Database. It's the breeding ground where they usually start.

Well what can I say, I started out build Access Databases and here I am six months later charging $110/hr to read blogs on the internet, which I am guessing is actually saving the client money by keeping me away from the codebase. Everybody wins.

Captcha: nibh - Where Billy Madison goes to school.

Re: Fred Blogs' MegaQuit()

2010-04-05 19:21 • by monkeypants
"Dim FredBlogs"
How prescient.

Re: Fred Blogs' MegaQuit()

2010-04-05 20:08 • by Aaron (unregistered)
Dim FredBlogs

That part seems accurate.

Re: Fred Blogs' MegaQuit()

2010-04-05 20:12 • by Aaron (unregistered)
304640 in reply to 304638
monkeypants:
"Dim FredBlogs"
How prescient.

Darn it, monkeypants. ;)

Re: Fred Blogs' MegaQuit()

2010-04-05 20:16 • by Abdiel
What it says:

Application will close. Continue?

OK / Cancel


What it means:

The application has closed already. If you had any files open, sucks to be you. But hey, if you want, press Cancel here and I will restart the application for you!

OK / Cancel

Re: Fred Blogs' MegaQuit()

2010-04-05 20:21 • by Fred Blogs (unregistered)
304642 in reply to 304641
Hey at least I gave them a moment of false hope, instead of those dialogs that say "you're toasted, all your data will be gone as soon as you click OK" and then only offer one choice: OK.

Re: Fred Blogs' MegaQuit()

2010-04-05 21:25 • by me (unregistered)
love how everything's a variant... great use of memory...

Re: Fred Blogs' MegaQuit()

2010-04-05 22:16 • by David W. Fenton (unregistered)
The intention of MegaQuit() is good, to provide a single exit point for the app, and to insure that cleanup code runs.

It's a horrid implementation, though.

As to closing forms before exit, it's not necessary, but there are reasons why you would do it because there's a certain bug in Access that when you close a form a certain way, a dirty record may not be saved.

Properly writing the code to handle that would mean checking if each form is dirty before closing it, and forcing the save before closing, so that if any errors happen in the save, it can be handled appropriately.

The criticism that the code is disorganized is completely correct though -- very user-hostile to lose the application state and *then* ask if they user wants to exit.

The other stuff is indefensibly comical.

I get hired all the time to fix old and broken Access apps. Most of them have absolutely no VBA code (though often hundreds of tangled macros), or only code that was created by the Access wizards. This one looks like it was written by someone who didn't understand the Access model (i.e., build your UI objects with point and click and wizards and then tie them together with some well-written code, only as much code as is essential to get the job done), perhaps a refugee from some other programming environment where you have to code the most basic functionality.

FWIW, I've seen really bizarre code in all sorts of different languages. I don't think there's anything specific about VBA/Access. Sturgeon's Law and all that...

--
David W. Fenton
David Fenton Associates
http://dfenton.com/DFA/

Re: Fred Blogs' MegaQuit()

2010-04-05 23:51 • by BentFranklin
Sure, you can post all nice and concise when you are using your real name, but the real test of character is if you can do it while anonymous.

Re: Fred Blogs' MegaQuit()

2010-04-06 01:05 • by japhyr
304651 in reply to 304577
Patrick:
You have to at least give credit to Fred for trying out some AI in the error handling. Too bad he basically made an artificial retard...


I joined just to say how MegaAwesome this comment is.

Re: Fred Blogs' MegaQuit()

2010-04-06 01:27 • by soporific (unregistered)
Damn! I wish i had thought of MegaQuit!

The database i currently maintain has Mega Search, just not Mega Quit. Damn!

Re: Fred Blogs' MegaQuit()

2010-04-06 03:42 • by Baaaaa! (unregistered)
Well, this makes perfect sense on an embedded platform with no file system. It's strange that nobody pointed it out already.

Re: Fred Blogs' MegaQuit()

2010-04-06 05:33 • by prueg
What, no IT Crowd reference?

Re: Fred Blogs' MegaQuit()

2010-04-06 06:45 • by filo (unregistered)
304659 in reply to 304623
Hexadecima:
BBT:
So, for HoldIt...
If you call it in the 59th second of the minute, it's guaranteed to infinitely loop. If you call it with "longish" >= 59, it is guaranteed to infinitely loop. If you call it with "longish" greater than or equal to 59 minus the current second, it will infinitely loop.

That's one brillant function.


ACTUALLY, HoldIt() would only loop for a minute, not infinitely. Seriously you guys. Seriously.


It loops infinitum depending on what time you call it. If we pass in 20 seconds and seconds(Now())=50 what is the max value of temp.

Re: Fred Blogs' MegaQuit()

2010-04-06 07:40 • by Curious Error Messager (unregistered)
Most of this is indeed awful - but the curious error message text is quite endearing and might have a point to it.

I've found that users' descriptions of error messages tend to be a little inaccurate, so I tend to write ones that are stylistically quirky so that they're easy to identify even when I hear a garbled account of them. This guy's users probably see errors even more than mine do, so it might be even more important to him.

CAPTCHA "odio" - I hate - but I don't, much

Re: Fred Blogs' MegaQuit()

2010-04-06 07:51 • by Anonymous (unregistered)
304661 in reply to 304612
Sponjk:
How, roughly, do you tell "Good" VB from "Bad" VB?

Easy - if you're currently residing in Opposite Land then it's all "good" VB. If you live in the real world with the rest of us it's all "bad" VB. Simple.

Re: Fred Blogs' MegaQuit()

2010-04-06 07:55 • by gdjfkghl (unregistered)
304662 in reply to 304622
Fred Blogs:

Hence my challenge. When an error message occurs they just ignore it. So I was asked to make them more amusing. No effect. They skip right by them. Finally, old skinflint himself told me -- not asked -- to lock up their computer after every error so they can't do anything else until they read the frickin screen already goddammit!


Did you redefine MsgBox sub? Can i see the code?

P. S.: CAPTCHA is "genitus"

Re: Fred Blogs' MegaQuit()

2010-04-06 08:27 • by Jaime
304663 in reply to 304644
me:
love how everything's a variant... great use of memory...

You don't really think that wasting 22 bytes is the worst part about using variants, do you?

Re: Fred Blogs' MegaQuit()

2010-04-06 10:42 • by JSampson (unregistered)
Ok my google foo is weak today, and I am not much of a DBA, what is a 'dirty' record? (aside from a music label in New Zealand)

Re: Fred Blogs' MegaQuit()

2010-04-06 12:01 • by Anonymous (unregistered)
304731 in reply to 304711
JSampson:
Ok my google foo is weak today, and I am not much of a DBA, what is a 'dirty' record? (aside from a music label in New Zealand)

For real? OK, well, it's just a modified (but unsaved) record. This is a common term that is not specific to DBs. Modified but unsaved.

Re: Fred Blogs' MegaQuit()

2010-04-06 12:56 • by frits
304741 in reply to 304731
Anonymous:
JSampson:
Ok my google foo is weak today, and I am not much of a DBA, what is a 'dirty' record? (aside from a music label in New Zealand)

For real? OK, well, it's just a modified (but unsaved) record. This is a common term that is not specific to DBs. Modified but unsaved.


OK, since you're answering questions. What if I replace record with Sanchez?

Re: Fred Blogs' MegaQuit()

2010-04-06 17:24 • by Hexadecima (unregistered)
304787 in reply to 304741
frits:
Anonymous:
JSampson:
Ok my google foo is weak today, and I am not much of a DBA, what is a 'dirty' record? (aside from a music label in New Zealand)

For real? OK, well, it's just a modified (but unsaved) record. This is a common term that is not specific to DBs. Modified but unsaved.


OK, since you're answering questions. What if I replace record with Sanchez?


Well, then it moves from New Zealand to California and becomes a band instead of a whole label.

Re: Fred Blogs' MegaQuit()

2010-04-06 19:45 • by Mr. Fancy Pants (unregistered)
<UT2004AnnouncerVoice>

M M M M MegaQuit!

</UT2004AnnouncerVoice>

Re: Fred Blogs' MegaQuit()

2010-04-07 20:46 • by Andrew Wade (unregistered)
304970 in reply to 304660
Curious Error Messager:
I've found that users' descriptions of error messages tend to be a little inaccurate, so I tend to write ones that are stylistically quirky so that they're easy to identify even when I hear a garbled account of them. This guy's users probably see errors even more than mine do, so it might be even more important to him.

In my Access apps, I've logged unexpected errors in addition to throwing up a dialog - I've found that works well and is worth adding ugly boiler-plate code to each function. (No tracebacks for errors are available - If you want to assemble a call stack for an error, you have to do it yourself. Bleh. And just give up on logging a line number for the error; there's no sane way to do that. But you can often guess what happened from just an error message and function name alone.)

Re: Fred Blogs' MegaQuit()

2010-04-07 23:14 • by David W. Fenton (unregistered)
304974 in reply to 304970
You can get the line number with Erl if you number the lines of code, like old-style BASIC.

Re: Fred Blogs' MegaQuit()

2010-04-08 03:06 • by Coder (unregistered)
304982 in reply to 304974
David W. Fenton:
You can get the line number with Erl if you number the lines of code, like old-style BASIC.


The crazy thing about that method is that the line numbers STAY THE SAME on each line, even when you add new code.

So you come back a year later, and line number 75832 still points to the same code it pointed to last year!

Crazy language.

Re: Fred Blogs' MegaQuit()

2010-04-08 07:22 • by lokey (unregistered)
304998 in reply to 304589
Bubba:
A bit of .Net would fix that right up.


But it needs XML too

Re: Fred Blogs' MegaQuit()

2010-04-08 10:27 • by Easily impressed (unregistered)
You comment guys and gals are aweseome.
As the manager of a small dev team, I now have this dream where I post my team's s**t code up here and have you guys gently and sardonically take the piss out of them.
Seriously, when you consider both the appalling level of sophistication, sensitivity and even basic grammar of your average YouTube comment, the comments here are on a godlike level.
Keep up the good work, you are all clearly wasted in your day jobs as coders.

Your reward is now to recieve my response to the original post, in the stylee of a YouTube commenter:

What the FUCK does WTF mean aneeway? YOU are all GAY! FredBloggs is a dickwit that probably sucks gay ass cos he is too fuked to actooally know shit like I do.
I bet he is blak too and anyway Laydy Gaga has a dik

Re: Fred Blogs' MegaQuit()

2010-04-08 19:20 • by Psyckers
At least the database admitted something was wrong rather than some other Access databases I have come across which tried to dismiss the error messages and go off in its own macro induced tangent, or like the one I had the misfortune to try and fix a couple of years ago where the message boxes and error messages bordered on abuse from the database.

One particular error message sprang to mind was:
'You forgot to enable the complier Smeghead, I will not do anything until you go back and turn the f**king thing on you sorry excuse for being Human.'

Needless to say one of the jobs my team had to fix was the supposed attitude problem the Access database had towards its users.

Re: Fred Blogs' MegaQuit()

2010-04-08 22:19 • by Andrew Wade (unregistered)
305161 in reply to 304974
David W. Fenton:
You can get the line number with Erl if you number the lines of code, like old-style BASIC.

Yeah, I decided numbering every line just for Erl just wasn't worth it.

Re: Fred Blogs' MegaQuit()

2010-04-12 12:53 • by computerquip (unregistered)
MegaComment()

Re: Fred Blogs' MegaQuit()

2011-08-06 23:25 • by LLJ (unregistered)
356198 in reply to 304570
Can't he go back and enter it now?
« PrevPage 1 | Page 2Next »

Add Comment