IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New The Obfuscated C Style Guide
How to write Unmaintainable Code

[link|http://mindprod.com/unmainobfuscation.html|http://mindprod.com/...nobfuscation.html]

Aside from being humorous, this is actually useful as a "never do this" guide.

edit: This is particularly hilarious:

C's Eccentric View Of Arrays

C compilers transform myArray[i] into *(myArray + i), which is equivalent to *(i + myArray) which is equivalent to i[myArray]. Experts know to put this to good use. To really disguise things, generate the index with a function:
\nint myfunc(int q, int p) { return p%q; } \n ... \n myfunc(6291, 8)[Array]; \n
-drl
Expand Edited by deSitter Dec. 8, 2003, 11:39:29 AM EST
Expand Edited by deSitter Dec. 8, 2003, 11:39:45 AM EST
New rofl you HAVE the read the whole thing
(my sides are splitting...)

Encapsulate The Trivial

Create entire classes or methods to encapsulate trivialities that could never possibly change, but which then require complex invocation, and careful unravelling to discover that the code does almost nothing. Here is a classic example:
\nclass Truth \n{ \n boolean isTrue ( boolean assertion ) \n{ \n if ( assertion != false ) return assertion; \n else return assertion; \n } \n} \n\n ... \n \n Truth trutherizer = new Truth() ; \n if ( trutherizer.isTrue ( s.equals( t ) ) ) doIt = true; \n else doIt = false; \n \n \n // hint: all the above accomplishes is: \n doIt = s.equals( t ); \n


OMG! When the customer input his name, the trutherizer threw an unhandled exception!
-drl
New Ack! Flashback.
Way back in college, I got 1 point taken off a programming assignment in CS 101 (the language was Pascal). Why 1 off? Because (and I don't remember Pascal's syntax exactly so this may not be precisely correct) I had written this:

while not eof(hFile)

My professor told me that I should have written a function called MoreData() that would return true if not end of file and false otherwise. If I had 'truly modular code' I would have then written

while MoreData(hFile)

I swear that is a true story.
bcnu,
Mikem

Java, Junk. Both start with a "J", both have four letters. Coincidence? I think not.
New LOL
>>>>>>>>>>>>>
Find a Forth or APL Guru
In those worlds, the terser your code and the more bizarre the way it works, the more you are revered.
<<<<<<<<<<<<<

Hello, Ross!
--

"There's nothing more nervous than a million dollars. It does not speak French, it does not speak English, it does not speak German and it moves very fast."

-- Jean Chretien
     The Obfuscated C Style Guide - (deSitter) - (3)
         rofl you HAVE the read the whole thing - (deSitter) - (1)
             Ack! Flashback. - (mmoffitt)
         LOL - (Arkadiy)

Sorry, what? I wasn't listening. I was fantasizing that I was far away, very alone, and reading a book.
76 ms