Jump to content

Recommended Posts

Posted

ITT: Snippets/screengrabs of horrible or otherwise funny code you've seen in the wild.

I'll start of with something I wrote myself. This is in fact valid C# and is meant to compare two abstract objects. It is a recursive(!) expression body using nested ternary operators. Funny enough, it had no negative impact on the code maintainability index:

cbc93.png

I will answer every single PM, and you are free to ask anything anytime.

Posted

Wait a moment ... I'm still searching my first AutoIt script I wrote many, many years ago ;)

It was in 2006 when I wrote a script to convert a bunch of CorelDraw files to WMF :x

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

I'm afraid to look at my really old stuff, but I have seen plenty of corkers here that would make mine look good.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Posted

That's why I didn't post my code - you shouldn't look to good ;)

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Yeah, I won't .... I've had a memory lapse and I can't remember where I put them. :blink:

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

  Reveal hidden contents

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Posted

In the last 4 decades the most horrible code i had seen....was mine :)

But sometimes there is a little piece of code, which impresses me so much...

Although I wrote Assembler-programs since time of 8088/8086, in the year 2006 a "little" program makes me smiiiile. There was a challenge writing the shortest code to solve a sudoku-puzzle at Hugi Size Coding Competition. Winner was a *.com-file DOS-program "designed" by a russian programmer. The file has a size of 62 bytes. Yes, bytes. Or 496 bits. Yes, bits...

It took me several hours and some sheets of paper to find out how these 62 bytes solve a sudoku. If you want to participate, have fun, you can download and run it, the only thing you need on a "modern" OS is the DOS-BOX emulator. if you have XP32, you can run it via CMD. 

Posted

@minxomat, that code might have been refactored by ReSharper, as they suggest some really weird optimisations. All in all though, it's a pretty decent plugin.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • 1 month later...
Posted (edited)

great terrible code that I thought about few days ago

$test = Multiply(287,100000000) ; Instead of 287*100000000
ConsoleWrite($test &' (L:'&@ScriptLineNumber&')'&@CRLF)

Func Multiply($num1,$num2)
    Local $Out
    For $a = 1 To $num2
        $Out += $num1
    Next
    Return $Out
EndFunc

 

Don't do this at home.

Edited by Guest

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...