Click here to Skip to main content
15,905,914 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: Here's one I just wrote myself Pin
megaadam12-Oct-17 2:45
professionalmegaadam12-Oct-17 2:45 
RantThe C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
geodoom11-Oct-17 11:35
geodoom11-Oct-17 11:35 
GeneralRe: The C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
den2k8811-Oct-17 22:04
professionalden2k8811-Oct-17 22:04 
GeneralRe: The C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
PeejayAdams11-Oct-17 23:49
PeejayAdams11-Oct-17 23:49 
GeneralRe: The C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
den2k8812-Oct-17 3:30
professionalden2k8812-Oct-17 3:30 
GeneralRe: The C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
megaadam12-Oct-17 3:59
professionalmegaadam12-Oct-17 3:59 
GeneralRe: The C++ primer 5th Edition (by Lippman ), an example of bad way to express something. Pin
madwilliamflint23-Oct-17 4:49
madwilliamflint23-Oct-17 4:49 
GeneralWhen variable names in C# get weird PinPopular
harold aptroot26-Sep-17 1:55
harold aptroot26-Sep-17 1:55 
GeneralRe: When variable names in C# get weird Pin
raddevus26-Sep-17 2:23
mvaraddevus26-Sep-17 2:23 
GeneralRe: When variable names in C# get weird Pin
Kornfeld Eliyahu Peter26-Sep-17 2:39
professionalKornfeld Eliyahu Peter26-Sep-17 2:39 
GeneralRe: When variable names in C# get weird Pin
OriginalGriff26-Sep-17 2:51
mveOriginalGriff26-Sep-17 2:51 
GeneralRe: When variable names in C# get weird Pin
harold aptroot26-Sep-17 2:57
harold aptroot26-Sep-17 2:57 
GeneralRe: When variable names in C# get weird Pin
OriginalGriff26-Sep-17 3:08
mveOriginalGriff26-Sep-17 3:08 
GeneralRe: When variable names in C# get weird Pin
RugbyLeague26-Sep-17 4:30
RugbyLeague26-Sep-17 4:30 
GeneralRe: When variable names in C# get weird Pin
Nicholas Marty26-Sep-17 4:47
professionalNicholas Marty26-Sep-17 4:47 
GeneralRe: When variable names in C# get weird Pin
raddevus27-Sep-17 2:02
mvaraddevus27-Sep-17 2:02 
GeneralRe: When variable names in C# get weird Pin
Nathan Minier28-Sep-17 1:59
professionalNathan Minier28-Sep-17 1:59 
GeneralRe: When variable names in C# get weird Pin
Richard Deeming28-Sep-17 3:43
mveRichard Deeming28-Sep-17 3:43 
GeneralRe: When variable names in C# get weird Pin
Nathan Minier28-Sep-17 3:47
professionalNathan Minier28-Sep-17 3:47 
GeneralWe don't work on Sundays Pin
kmoorevs22-Sep-17 9:34
kmoorevs22-Sep-17 9:34 
GeneralRe: We don't work on Sundays Pin
PIEBALDconsult22-Sep-17 14:31
mvePIEBALDconsult22-Sep-17 14:31 
GeneralRe: We don't work on Sundays Pin
kmoorevs23-Sep-17 3:59
kmoorevs23-Sep-17 3:59 
GeneralRe: We don't work on Sundays Pin
Richard Deeming25-Sep-17 2:35
mveRichard Deeming25-Sep-17 2:35 
No, the real corrected code is:
VB.NET
rText2 = myCurrentDate.ToString("dddd")

Custom Date and Time Format Strings | Microsoft Docs[^]

Or, if you really want to pad the code out:
VB.NET
rText2 = System.Globalization.DateTimeFormatInfo.CurrentInfo.GetDayName(myCurrentDate.DayOfWeek)


The vast majority of the Microsoft.VisualBasic assembly is just there for backwards-compatibility with VB6, and should be avoided wherever possible. Smile | :)



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: We don't work on Sundays Pin
kmoorevs25-Sep-17 4:26
kmoorevs25-Sep-17 4:26 
GeneralThis seriously belongs here... PinPopular
Brisingr Aerowing16-Sep-17 17:22
professionalBrisingr Aerowing16-Sep-17 17:22 

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.