Click here to Skip to main content
15,886,518 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: Lets' change things up; how about the inept and stupid Pin
Marc Clifton27-Mar-20 8:16
mvaMarc Clifton27-Mar-20 8:16 
GeneralRe: Lets' change things up; how about the inept and stupid Pin
Greg Utas27-Mar-20 11:01
professionalGreg Utas27-Mar-20 11:01 
GeneralWonderful: For those of you that want to teach yourself more advanced CS concepts Pin
honey the codewitch26-Feb-20 9:44
mvahoney the codewitch26-Feb-20 9:44 
GeneralRe: Wonderful: For those of you that want to teach yourself more advanced CS concepts Pin
Amarnath S26-Feb-20 13:32
professionalAmarnath S26-Feb-20 13:32 
GeneralRe: Wonderful: For those of you that want to teach yourself more advanced CS concepts Pin
vaghelabhavesh27-Feb-20 8:40
vaghelabhavesh27-Feb-20 8:40 
GeneralRe: Wonderful: For those of you that want to teach yourself more advanced CS concepts Pin
John R. Shaw26-Mar-20 20:02
John R. Shaw26-Mar-20 20:02 
GeneralRe: Wonderful: For those of you that want to teach yourself more advanced CS concepts Pin
honey the codewitch26-Mar-20 20:16
mvahoney the codewitch26-Mar-20 20:16 
GeneralThis Definitely Falls into the Wonderful Camp Pin
David A. Gray9-Feb-20 11:14
David A. Gray9-Feb-20 11:14 
When I saw a cmovne instruction in a disassembly through which I am tracing, I asked Bing what it was, and got the details at Purpose of cmove instruction in x86 assembly? - Stack Overflow, which are borne out by the demonstrated behavior of my code. It appears that the Visual C++ compiler that ships with Visual Studio 2019 counts the cost of two mov instructions followed by a cmovne instruction as less than that of a branch that causes both to execute anyway, even though the outcome of one of the two mov instructions would eventually be discarded.

Moreover, this is happening in a debug build!

This is by no means the first such unexpected optimization that I've seen the MSVC compiler generate in a debug build.
David A. Gray
Delivering Solutions for the Ages, One Problem at a Time
Interpreting the Fundamental Principle of Tabular Reporting

GeneralRe: This Definitely Falls into the Wonderful Camp Pin
Randor 10-Feb-20 12:33
professional Randor 10-Feb-20 12:33 
GeneralRe: This Definitely Falls into the Wonderful Camp Pin
David A. Gray11-Feb-20 10:33
David A. Gray11-Feb-20 10:33 
GeneralRe: This Definitely Falls into the Wonderful Camp Pin
Randor 11-Feb-20 12:40
professional Randor 11-Feb-20 12:40 
GeneralVisual Studio 2019 and the Weird, Wonderful Nonbreaking Space Pin
David A. Gray8-Feb-20 11:33
David A. Gray8-Feb-20 11:33 
GeneralRe: Visual Studio 2019 and the Weird, Wonderful Nonbreaking Space Pin
Super Lloyd29-Mar-20 13:50
Super Lloyd29-Mar-20 13:50 
GeneralRe: Visual Studio 2019 and the Weird, Wonderful Nonbreaking Space Pin
Greg Utas29-Mar-20 14:31
professionalGreg Utas29-Mar-20 14:31 
PraiseI might have cause to be grateful for javascript for once Pin
honey the codewitch6-Feb-20 22:01
mvahoney the codewitch6-Feb-20 22:01 
GeneralRe: I might have cause to be grateful for javascript for once Pin
GuyThiebaut11-Feb-20 21:55
professionalGuyThiebaut11-Feb-20 21:55 
GeneralRe: I might have cause to be grateful for javascript for once Pin
honey the codewitch26-Feb-20 9:51
mvahoney the codewitch26-Feb-20 9:51 
GeneralIncomprehensible C++ error messages PinPopular
Alan Balkany29-Jan-20 10:19
Alan Balkany29-Jan-20 10:19 
GeneralRe: Incomprehensible C++ error messages PinPopular
RugbyLeague29-Jan-20 21:16
RugbyLeague29-Jan-20 21:16 
GeneralRe: Incomprehensible C++ error messages Pin
honey the codewitch29-Mar-20 15:02
mvahoney the codewitch29-Mar-20 15:02 
GeneralRe: Incomprehensible C++ error messages Pin
Greg Utas30-Jan-20 14:32
professionalGreg Utas30-Jan-20 14:32 
GeneralRe: Incomprehensible C++ error messages PinPopular
Member 91670572-Feb-20 22:45
Member 91670572-Feb-20 22:45 
RantRe: Incomprehensible C++ error messages Pin
Gary Wheeler3-Feb-20 2:53
Gary Wheeler3-Feb-20 2:53 
GeneralRe: Incomprehensible C++ error messages Pin
Bob10003-Feb-20 7:06
professionalBob10003-Feb-20 7:06 
GeneralRe: Incomprehensible C++ error messages Pin
SeattleC++3-Feb-20 4:47
SeattleC++3-Feb-20 4:47 

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.