Arthur Fuller
artful at rogers.com
Thu Aug 12 12:14:09 CDT 2004
The Naming Conventions thread has been most interesting and has prompted me to suggest an annual contest a la the classic DDJ C-Obfuscation contest. The point is to write a geruinely incomprehensible routine that does something useful. It would only make sense if we confined ourselves to say 5 candidate routines, Access-specific of course. Contributors could then submit a "solution" to any of the 5 problems. (A double-prize might be considered for code that does not even make it apparent which problem it is solving!) Step 1 is to gather the list of problems. I venture the following merely as a starting point. I haven't given any of them a lot of consideration, they are nothing more than something to shoot at, if you will. Somehow let's settle on 5 problems worth obfuscating. After that, obfuscation will be, heh heh, obvious. Herewith, 5 problems. Please feel free to shoot them down as insignificant or not worth writing etc. I would love to have the list come up with 5 genuinely interesting problems, on which to base the obfuscated solutions. None of them would be immediately useful in anyone's current project, but I think it would be fun to see the variants that contestants come up with. Five initial examples. Fire at will. Please come up with more interesting problems! 1. For every open form for every textbox make it read-only change the colours 2. Given tables Parent and Child, delete every third Parent record and all her children in the Child table. 3. Manufacture some test data in 4 tables: parent, child1, child2, and child2's child. The routine accepts the number of parents to create and the maximum number of child rows to create. Then it randomly adds kids (and grandkids) to tables 2, 3 and 4 for each parent, using the specified maximum. 4. Delete every file from every directory to which the user has access, while presenting warm and fuzzy messages. (Don't really delete them, just print a message suggesting that could have. Option: Tell them you HAVE deleted them, and offer recovery for $.05 a file. Bring up PayPal to complete the transaction. 5. Create an email to every person in your Outlook Contacts folder, announcing that your surgery was unsuccessful and you are now a refridgerator salesperson in Resolute Bay. Five stupid problems, I admit. Let's come up with five smart problems and then obfuscate their solutions! (At the least, each problem could become an issue of our newsletter, including the various solutions sent in by listers.) One obvious obfuscation technique is purposeful misuse of Hungarian. Dim strValue as Long ' the number of striations per meter of a given cave wall. Dim datLast as Currency ' how much you paid the hooker for your last "date". Dim booLevel as Byte ' scare factor in a horror movie focus group. Dim booLevel as Long ' WWE measurement as reported by microphones. Dim cboAvail as Boolean ' is this jazz musician available for work in a combo? But there are many more. Table names offer abundant opportunities to play. You get the idea, I hope.... Arthur