Click here to Skip to main content
15,899,124 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: Someone please help me .... Pin
cpkilekofp25-Sep-08 4:05
cpkilekofp25-Sep-08 4:05 
GeneralYou *must* focus! Pin
to_be_defined11-Sep-08 2:13
to_be_defined11-Sep-08 2:13 
JokeRe: You *must* focus! Pin
Paul Conrad11-Sep-08 4:34
professionalPaul Conrad11-Sep-08 4:34 
JokeRe: You *must* focus! Pin
CPallini11-Sep-08 5:21
mveCPallini11-Sep-08 5:21 
GeneralRe: You *must* focus! Pin
Pete O'Hanlon11-Sep-08 11:05
mvePete O'Hanlon11-Sep-08 11:05 
JokeRe: You *must* focus! Pin
Yusuf15-Sep-08 5:27
Yusuf15-Sep-08 5:27 
GeneralRe: You *must* focus! Pin
cpkilekofp25-Sep-08 4:07
cpkilekofp25-Sep-08 4:07 
GeneralOne guidelines for C/C++ programmer Pin
asadullah ansari8-Sep-08 4:03
asadullah ansari8-Sep-08 4:03 
In your project, If you are using if condition like

enum
{
  Blue_c,
  Yellow_c,
  Red_c  
};
int color;

if( color == yellow_c)
{
  .....
  ......
}
or
if(color != Red_c)
{
   ....
   .....
} 


Now you know by mistake if you forget one = or !
means if(color = yellow_c) or if(color = Red_c)
then no error will come and bug fixing cost for your projects

So To avoid this cost you should use

if(yellow_c == color)
{
  .....
  ......
}
or
if(Red_c != color)
{
   ....
   .....
} 


Now if you forgot to put one = ot ! then compilation error will come..

So this should be in coding standard to use like this...

Truth Can'nt be changed

AnswerRe: One guidelines for C/C++ programmer Pin
leppie8-Sep-08 4:40
leppie8-Sep-08 4:40 
JokeRe: One guidelines for C/C++ programmer Pin
BadKarma8-Sep-08 4:46
BadKarma8-Sep-08 4:46 
JokeRe: One guidelines for C/C++ programmer Pin
leppie8-Sep-08 4:49
leppie8-Sep-08 4:49 
GeneralRe: One guidelines for C/C++ programmer Pin
BadKarma8-Sep-08 5:11
BadKarma8-Sep-08 5:11 
GeneralRe: One guidelines for C/C++ programmer Pin
cpkilekofp25-Sep-08 4:10
cpkilekofp25-Sep-08 4:10 
JokeRe: One guidelines for C/C++ programmer PinPopular
CPallini8-Sep-08 9:05
mveCPallini8-Sep-08 9:05 
GeneralRe: One guidelines for C/C++ programmer Pin
asadullah ansari9-Sep-08 2:58
asadullah ansari9-Sep-08 2:58 
GeneralRe: One guidelines for C/C++ programmer Pin
CPallini9-Sep-08 3:14
mveCPallini9-Sep-08 3:14 
JokeRe: One guidelines for C/C++ programmer Pin
leonej_dt18-Sep-08 21:43
leonej_dt18-Sep-08 21:43 
JokeRe: One guidelines for C/C++ programmer Pin
CPallini18-Sep-08 21:57
mveCPallini18-Sep-08 21:57 
GeneralRe: One guidelines for C/C++ programmer Pin
cpkilekofp25-Sep-08 4:12
cpkilekofp25-Sep-08 4:12 
GeneralRe: One guidelines for C/C++ programmer Pin
PIEBALDconsult8-Sep-08 17:36
mvePIEBALDconsult8-Sep-08 17:36 
GeneralRe: One guidelines for C/C++ programmer Pin
cpkilekofp25-Sep-08 4:13
cpkilekofp25-Sep-08 4:13 
GeneralRe: One guidelines for C/C++ programmer Pin
PIEBALDconsult25-Sep-08 5:33
mvePIEBALDconsult25-Sep-08 5:33 
GeneralRe: One guidelines for C/C++ programmer Pin
Joe Woodbury8-Sep-08 17:50
professionalJoe Woodbury8-Sep-08 17:50 
GeneralRe: One guidelines for C/C++ programmer Pin
cpkilekofp25-Sep-08 4:14
cpkilekofp25-Sep-08 4:14 
GeneralRe: One guidelines for C/C++ programmer PinPopular
BadKarma8-Sep-08 20:36
BadKarma8-Sep-08 20:36 

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.