Click here to Skip to main content
15,912,897 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: To me this is a coding horror, and to you? Pin
leonej_dt25-Sep-08 9:41
leonej_dt25-Sep-08 9:41 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp25-Sep-08 10:16
cpkilekofp25-Sep-08 10:16 
JokeRe: To me this is a coding horror, and to you? Pin
leonej_dt25-Sep-08 10:19
leonej_dt25-Sep-08 10:19 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp25-Sep-08 10:25
cpkilekofp25-Sep-08 10:25 
GeneralRe: To me this is a coding horror, and to you? Pin
leonej_dt25-Sep-08 10:56
leonej_dt25-Sep-08 10:56 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp29-Sep-08 4:03
cpkilekofp29-Sep-08 4:03 
GeneralRe: To me this is a coding horror, and to you? Pin
leonej_dt29-Sep-08 17:49
leonej_dt29-Sep-08 17:49 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp30-Sep-08 7:00
cpkilekofp30-Sep-08 7:00 
leonej_dt wrote:
cpkilekofp wrote:
is a C# example, not a C example.


Excuse me, sir. You are wrong. The IS_NOT_ZERO macro is a C example, not a C# one. You can't apply the ! operator to an integer in C#. You can do that in C.


Excuse me, sir, but the original coding horror in this thread is a C# coding horror, not a C coding horror, thus my comments about using booleans where you MEAN it is either true or false are appropriate, while your comments that it doesn't make a difference apply to C where booleans (at least for most of the language's lifespan) were not supported; is that, finally, clear?.

Additonally, I based my comments regarding your statements about coding standards on what exactly you wrote; getting upset because I responded to, again, exactly what you wrote rather than what you actually do would seem to me to be a problem with your description. Further, I wasn't referring to your code when I commented about "indentation" - how could I, when the only piece of code from you that I saw was a single line? However, I've had to read, debug, and modify more than one piece of obscure C that made it into production in the time before code reviews became commonplace.

In general, the comments you've made on this topic are in line with what I call "C bigotry", an attitude that naturally comes to most good C programmers (I was most definitely guilty of it when C was my primary development language). The elegance and concision of C creates in the C developer an automatic contempt for languages which lack those features, and for those who find it difficult to impossible to read C when used by one well versed in all its subtleties. Please note: back when I was using C regularly, we had macros almost identical to yours to convert integers to true/false when we were building files for processing by, say, COBOL mainframe programs that looked for 0 or 1 as false or true (about 17-18 years ago), so I don't see your macro as a joke; however, I do view your comment as an indicator that, perhaps, your experience in different arenas of development seems to not be as widespread as mine (this is NOT a comment on your skill, just on the limited number and type of programming environments to which you have been exposed - once you reach the point where you are working with junior programmers with much less skill than you have, some of these points will not only be clearer to you, they'll seem like "common sense").
GeneralRe: To me this is a coding horror, and to you? Pin
leonej_dt1-Oct-08 15:18
leonej_dt1-Oct-08 15:18 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp2-Oct-08 5:49
cpkilekofp2-Oct-08 5:49 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp2-Oct-08 7:03
cpkilekofp2-Oct-08 7:03 
GeneralRe: To me this is a coding horror, and to you? Pin
geoffs2-Oct-08 10:34
geoffs2-Oct-08 10:34 
GeneralRe: To me this is a coding horror, and to you? Pin
David St. Hilaire24-Sep-08 14:01
David St. Hilaire24-Sep-08 14:01 
GeneralRe: To me this is a coding horror, and to you? Pin
cpkilekofp25-Sep-08 3:49
cpkilekofp25-Sep-08 3:49 
GeneralSomeone please help me .... PinPopular
Monty211-Sep-08 18:27
Monty211-Sep-08 18:27 
GeneralRe: Someone please help me .... Pin
StM0n11-Sep-08 23:45
StM0n11-Sep-08 23:45 
JokeRe: Someone please help me .... Pin
BadKarma11-Sep-08 23:58
BadKarma11-Sep-08 23:58 
GeneralRe: Someone please help me .... Pin
dojohansen16-Sep-08 2:22
dojohansen16-Sep-08 2:22 
GeneralRe: Someone please help me .... Pin
cpkilekofp25-Sep-08 3:58
cpkilekofp25-Sep-08 3:58 
GeneralRe: Someone please help me .... Pin
Nagy Vilmos12-Sep-08 2:26
professionalNagy Vilmos12-Sep-08 2:26 
JokeRe: Someone please help me .... Pin
Chris Meech12-Sep-08 2:39
Chris Meech12-Sep-08 2:39 
JokeRe: Someone please help me .... Pin
CPallini12-Sep-08 3:35
mveCPallini12-Sep-08 3:35 
GeneralRe: Someone please help me .... Pin
dojohansen16-Sep-08 2:24
dojohansen16-Sep-08 2:24 
GeneralRe: Someone please help me .... Pin
CPallini16-Sep-08 2:30
mveCPallini16-Sep-08 2:30 
GeneralRe: Someone please help me .... Pin
geoffs12-Sep-08 5:32
geoffs12-Sep-08 5:32 

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.