Click here to Skip to main content
15,893,663 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.

 
GeneralRe: shame to my tester or me? Pin
englebart3-May-12 2:33
professionalenglebart3-May-12 2:33 
GeneralRe: shame to my tester or me? Pin
Anna-Jayne Metcalfe3-May-12 4:49
Anna-Jayne Metcalfe3-May-12 4:49 
GeneralRe: shame to my tester or me? Pin
Eugene Peng3-May-12 13:43
Eugene Peng3-May-12 13:43 
GeneralRe: shame to my tester or me? Pin
KP Lee5-May-12 11:21
KP Lee5-May-12 11:21 
GeneralRe: shame to my tester or me? Pin
pietvredeveld4-May-12 7:58
pietvredeveld4-May-12 7:58 
GeneralRe: shame to my tester or me? Pin
KP Lee5-May-12 10:11
KP Lee5-May-12 10:11 
GeneralSetDate Pin
loctrice26-Apr-12 8:06
professionalloctrice26-Apr-12 8:06 
GeneralRe: SetDate Pin
Brisingr Aerowing26-Apr-12 8:15
professionalBrisingr Aerowing26-Apr-12 8:15 
Issues I found:

1. It doesn't even set anything
2. It uses Long (Int64) while the constructor takes Integer (Int32)
3. Declares a temporary variable to be returned the next line
4. Why is it dTemp2?

My way (I will keep the same name, mainly because I can't think of any other):

VB
Function SetDate(ByVal nYear As Int32, ByVal nMonth As Int32, ByVal nDay As Int32, ByVal nHour As Int32, ByVal nMinute As Int32, ByVal nSecond As Int32) As Date
           Return New Date(nYear, nMonth, nDay, nHour, nMinute, nSecond)
    End Function

All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value.
Carl Sagan

GeneralRe: SetDate Pin
loctrice26-Apr-12 8:52
professionalloctrice26-Apr-12 8:52 
GeneralRe: SetDate Pin
GibbleCH26-Apr-12 9:00
GibbleCH26-Apr-12 9:00 
GeneralRe: SetDate Pin
Brisingr Aerowing26-Apr-12 9:06
professionalBrisingr Aerowing26-Apr-12 9:06 
GeneralRe: SetDate Pin
Brisingr Aerowing26-Apr-12 9:05
professionalBrisingr Aerowing26-Apr-12 9:05 
GeneralRe: SetDate Pin
loctrice26-Apr-12 11:01
professionalloctrice26-Apr-12 11:01 
GeneralRe: SetDate Pin
Brisingr Aerowing26-Apr-12 12:54
professionalBrisingr Aerowing26-Apr-12 12:54 
GeneralRe: SetDate Pin
loctrice26-Apr-12 16:01
professionalloctrice26-Apr-12 16:01 
JokeRe: SetDate Pin
AspDotNetDev26-Apr-12 13:45
protectorAspDotNetDev26-Apr-12 13:45 
GeneralRe: SetDate Pin
Bernhard Hiller26-Apr-12 22:02
Bernhard Hiller26-Apr-12 22:02 
GeneralRe: SetDate Pin
loctrice27-Apr-12 1:53
professionalloctrice27-Apr-12 1:53 
GeneralRe: SetDate Pin
R. Giskard Reventlov27-Apr-12 12:39
R. Giskard Reventlov27-Apr-12 12:39 
GeneralThats why i hate c++ Pin
Vasily Tserekh24-Apr-12 3:35
Vasily Tserekh24-Apr-12 3:35 
GeneralRe: Thats why i hate c++ Pin
Vasily Tserekh24-Apr-12 3:43
Vasily Tserekh24-Apr-12 3:43 
GeneralRe: Thats why i hate c++ PinPopular
glennPattonWork327-Apr-12 0:18
professionalglennPattonWork327-Apr-12 0:18 
GeneralRe: Thats why i hate c++ Pin
Member 376360827-Apr-12 7:48
Member 376360827-Apr-12 7:48 
GeneralRe: Thats why i hate c++ Pin
StephenPhillips29-Apr-12 0:28
StephenPhillips29-Apr-12 0:28 
GeneralRe: Thats why i hate c++ Pin
Keith.Badeau29-Apr-12 6:25
Keith.Badeau29-Apr-12 6:25 

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.