|
You must be new to this coding thing... you will see stuff that's far worse.
|
|
|
|
|
pretty much sums it up.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Resign now. Don't expose yourself to such level of idiocy, unless you really need the money. And if you can't resign, ensure you make your coworker feel "proud" enough of his achievement to never do such a thing again!
Ok, don't be too harsh.
To those who understand, I extend my hand.
To the doubtful I demand: Take me as I am.
Not under your command, I know where I stand.
I won't change to fit yout plan. Take me as I am.
|
|
|
|
|
Monty2 wrote: if(i==0) *outcallRecvCount = 0; else *outcallRecvCount = i ;
Actually, I use constructs similar to this while debugging. Conditional breakpoints can be very expensive in time when one is running a source-level debugger. To avoid dying of old age while the program executes in the debugger, I'll create an if-block like this, then set an unconditional breakpoint on, say, the *outcallRevCount = 0 line; that way, the debugger runs much faster, and I get the debugger to stop when i == 0. Leaving it in production code, however, is sloppy to say the least.
|
|
|
|
|
void CWhatever::OnOK()
{
CWnd* pWnd = GetFocus();
if (pWnd)
pWnd->SetFocus();
CTabPage::OnOK();
}
The function was appropriately commented with a Doxygen comment stating "OK. This method is called by the framework when the user chooses the OK button."
|
|
|
|
|
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
That's the reason C++ is called an IMPERATIVE LANGUAGE.
BTW it reminds my another (already posted) horror:
If a=1 And a<>2 And a<>3 Then
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Sorry - losing focus now. Need caffeine.
|
|
|
|
|
No, caffeine or no caffeine, you *must* focus, NOW...
Yusuf
|
|
|
|
|
|
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
|
|
|
|
|
|
That's correct, in fact here we encourage people to use
the most ugly, unwell formed and disaster bringing code
that they may come up to.
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
BadKarma wrote: That's correct, in fact here we encourage people to use
the most ugly, unwell formed and disaster bringing code
that they may come up to. Poke tongue
Or otherwise known as: Job Security
|
|
|
|
|
We should write our own coding standard.
For beginner
- Writing Code Horrors for dummies
- Learn to Code in Horror Style in 21 days
For Professionals
- Advanced Horror Techniques : When template gone wrong
- Gibberish : Take your obfuscation skill to a higher level
Learn from the mistakes of others, you may not live long enough to make them all yourself.
|
|
|
|
|
BadKarma wrote: That's correct, in fact here we encourage people to use
the most ugly, unwell formed and disaster bringing code
that they may come up to.
I think you should have had some coffee before making this statement, as he is exactly right. Placing the constant first will catch this error, which is one of the common typographic errors in C-style languages.
|
|
|
|
|
Real C programmers (i.e. real men) don't use such girly tricks. They bravely make mistakes whenever is needed.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am not talking about a single or some person who can take care his code itself nicely. But when you will come to some big organization then Why they follows some process becausethey want minimize defects, minimize manpower,etc. So this small care can save some time .
Truth Can'nt be changed
|
|
|
|
|
asadullah ansari wrote: minimize manpower
Hence not a real-men company!
BTW What is the point on minimizing manpower in software industry? Our work is creative after all, don't you agree?
The Software Laborer
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
We should create the union of real men, excuse me, C programmers. We'd fight to protect our jobs, our interests and our bugs!
To those who understand, I extend my hand.
To the doubtful I demand: Take me as I am.
Not under your command, I know where I stand.
I won't change to fit yout plan. Take me as I am.
|
|
|
|
|
leonej_dt wrote: We should create the union of real men, excuse me, C programmers.
Definitely.
leonej_dt wrote: We'd fight to protect our jobs,
That's not needed. Other 'programmers' with their 'masterpieces' keep our jobs safe.
leonej_dt wrote: We'd fight to protect our our interests and our bugs!
Definitely again.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: BTW What is the point on minimizing manpower in software industry? Our work is creative after all, don't you agree?
The Software Laborer
*SEXIST STATEMENT WARNING* I like to maximize the girl power in my environment...as long as I get to stick around as the token alpha male *END SEXIST STATEMENT*
|
|
|
|
|
Oh, a coding standards horror.
That only works when comparing an Lvalue and an Rvalue, and if a programmer can remember to do that, then he can remember to use the correct operator in the first place.
Newbies will continue to screw it up, and experienced programmers will continue to get it right the first time.
One company I worked for did have that in the coding standard, but even the guy who defined the standards admitted that it was pretty useless.
If it causes you trouble you could switch to D, which will throw an error if it's not done right (if I recall correctly).
|
|
|
|
|
PIEBALDconsult wrote: That only works when comparing an Lvalue and an Rvalue, and if a programmer can remember to do that, then he can remember to use the correct operator in the first place.
Newbies will continue to screw it up, and experienced programmers will continue to get it right the first time.
You've obviously never worked a 48-hour day.
|
|
|
|
|
No, uh uh. The longest day I ever worked was 28 hours... and I fell asleep.
|
|
|
|