Click here to Skip to main content
16,014,588 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralAwesome! Pin
jchigg200024-Jul-07 8:10
jchigg200024-Jul-07 8:10 
GeneralRe: Awesome! Pin
Andy Brummer24-Jul-07 8:28
sitebuilderAndy Brummer24-Jul-07 8:28 
GeneralRe: Awesome! Pin
dighn24-Jul-07 10:29
dighn24-Jul-07 10:29 
GeneralRe: Awesome! Pin
Andy Brummer24-Jul-07 10:34
sitebuilderAndy Brummer24-Jul-07 10:34 
GeneralRe: Awesome! Pin
Vasudevan Deepak Kumar28-Jul-07 22:01
Vasudevan Deepak Kumar28-Jul-07 22:01 
GeneralRe: Awesome! Pin
jchigg200024-Jul-07 10:38
jchigg200024-Jul-07 10:38 
GeneralRe: Awesome! Pin
chrishuff25-Jul-07 9:23
chrishuff25-Jul-07 9:23 
GeneralRe: Awesome! Pin
Ian Shlasko27-Jul-07 11:20
Ian Shlasko27-Jul-07 11:20 
There's a third... Which I just dealt with today in an old Excel VBA macro (Essentially VB6)...

(Hastily-written, VB-style pseudo-code, as it's faster than removing the proprietary stuff)

For x = 1 to 13
  Dim line As String
  line = GetLine(x, username, code, thing, item, anotherstring, andanother, blah, blah, blah, blah, blah)

  (Do something with line...)

Next x

...

Public Function GetLine(x As Long, username As String, etc etc etc etc etc)
  Select Case x
    Case 0
      GetLine = "SomeString="&username
    Case 1
      GetLine = "Something Else=" & code
    Case 2
      GetLine = "Another Thing=" & thing
    ...
    Case 13
      GetLine = "Some literal string"
  End Select
End Function



Yes, it passes all those parameters to the function 13 times. Yes, it only uses one of those parameters each time. Yes, every member of that select statement is a simple concatenation of a literal with a string parameter (If even that). Yes, I replaced the whole system with a C# utility as fast as I could.
GeneralRe: Awesome! Pin
John R. Shaw27-Jul-07 23:39
John R. Shaw27-Jul-07 23:39 
GeneralClassic Pin
User 274316224-Jul-07 4:56
User 274316224-Jul-07 4:56 
GeneralRe: Classic Pin
Tristan Rhodes24-Jul-07 5:26
Tristan Rhodes24-Jul-07 5:26 
GeneralRe: Classic Pin
dojohansen20-Aug-07 2:13
dojohansen20-Aug-07 2:13 
GeneralRe: Classic Pin
dighn24-Jul-07 6:44
dighn24-Jul-07 6:44 
GeneralRe: Classic Pin
User 274316224-Jul-07 9:24
User 274316224-Jul-07 9:24 
GeneralRe: Classic Pin
dighn24-Jul-07 10:27
dighn24-Jul-07 10:27 
GeneralRe: Classic Pin
User 274316224-Jul-07 21:00
User 274316224-Jul-07 21:00 
GeneralRe: Classic Pin
User 274316224-Jul-07 22:42
User 274316224-Jul-07 22:42 
GeneralRe: Classic Pin
wk63327-Jul-07 10:36
wk63327-Jul-07 10:36 
GeneralRe: Classic Pin
OR0N28-Jul-07 5:58
OR0N28-Jul-07 5:58 
GeneralRe: Classic Pin
User 274316228-Jul-07 7:58
User 274316228-Jul-07 7:58 
GeneralRe: Classic Pin
OR0N28-Jul-07 21:41
OR0N28-Jul-07 21:41 
GeneralRe: Classic Pin
Tom Clement29-Feb-24 10:36
professionalTom Clement29-Feb-24 10:36 
GeneralRe: Classic Pin
peterchen26-Jul-07 11:59
peterchen26-Jul-07 11:59 
GeneralRe: Classic Pin
Vasudevan Deepak Kumar26-Jul-07 22:52
Vasudevan Deepak Kumar26-Jul-07 22:52 
GeneralRe: Classic Pin
John R. Shaw27-Jul-07 23:53
John R. Shaw27-Jul-07 23:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.