Subj : Re: Syntax, style, the infinite monkey theorum and coding To : comp.programming From : Ed Prochak Date : Fri Aug 19 2005 11:49 am gsw...@mailcity.com wrote: > http://en.wikipedia.org/wiki/Infinite_monkey_theorem > contains a high quality entry on the theorum [] > then pointing out that infinity isn't required (it would actually > guarantee an infite amount of copies of all texts) > > "a thousand monkeys typing random letters at 100 characters per minute > would very likely type the word "banana" within 6 weeks." > > what they didn't mention was that, intriguingly, it only takes few > monkeys feverishly hitting the keyboard and making generous but > unpredictable use of the shift key to immediately start producing > functioning perl code! > > erm... only joking. > > okay, so i can't follow perl code - some times it just looks like so > much: > hjgf$~@//\4-abc/\%$@ > in fact that snippet might be really useful to someone! > > Any favourite code snippets you've seen that have that 'many monkeys' > appearance? I don't mean deliberate obfuscation, but some working code > you've seen. Sadly I have. > > Code snippets with that 'monkeys' feel are kind of like modern art - > you're aware that it's supposed to mean something and that it may well > be very clever, but you can't help feeling that a 3 year old, or indeed > a money, would happily and readily, but unintentially, hammer out the > exact same! how about a C program with a seven page while() loop where the condition on the while() loop was seven full lines long (where full means about 70characters per line, not counting whitespace)? Sorry I don't have the code available. That was at a job nearly twenty years ago. It was written by a contractor that the company respected and was considered a great programmer. Needless to say I did not share that opinion when I was assigned to maintain and debug this beast. .