|
Ahh... admittedly, I've been guilty of leaving commented code behind, but they were left behind to work with later. However, I don't think I ever commented copied code like that...
|
|
|
|
|
I'll admit to leaving comments behind when I'm designing new stuff but want to be able to refer to the old stuff, but I only leave it there when I forget or get distracted before finishing the new function.
|
|
|
|
|
Users should left a reason for voting,either it is good or bad. It will make other users to think better in future.I have noticed some users never do it.is it good ? let others users know what is the point that you appreciate or not like.. Thanks to all.
modified on Thursday, March 3, 2011 4:07 PM
|
|
|
|
|
What the heck are you on about?
|
|
|
|
|
|
Monjurul Habib wrote: that is you,5+
Huh?
|
|
|
|
|
|
Hi it's me, the Monthy Python!
|
|
|
|
|
I voted you a 5 what's the point of voting someone a 1 unless you tell them why. Will they learn from their mistake, probably not.
"You get that on the big jobs."
|
|
|
|
|
my view is better to point him, where he made mistake.).
|
|
|
|
|
This is already implemented in some places of the forum... Anyway... if you want to make suggestions you should use the right forum...
|
|
|
|
|
I downloaded some code of the internet which is used as part of Firefox, OpenOffice etc, compiled it and it produced a few warnings. I'm not a fan of warnings so thought I'd have a look to fix it...
if (((rv) &&
( checked_prefix || (words && words[wnum]) ||
(compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen))
|| ((langnum == LANG_hu) && hu_mov_rule && (
TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) ||
TESTAFF(rv->astr, 'H', rv->alen)
)
)
) &&
(
scpd == 0 || checkcpdtable[scpd-1].cond == FLAG_NULL ||
TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen)
)
&& ! (( checkcompoundtriple && scpd == 0 && !words && (word[i-1]==word[i]) && (
((i>1) && (word[i-1]==word[i-2])) ||
((word[i-1]==word[i+1])) )
) ||
(
checkcompoundcase && scpd == 0 && !words && cpdcase_check(word, i)
))
)
|| ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st,i)) &&
(sfx && sfx->getCont() && ( TESTAFF(sfx->getCont(), (unsigned short) 'x', sfx->getContLen()) ||
TESTAFF(sfx->getCont(), (unsigned short) '%', sfx->getContLen())
)
)
)
) {
}
In fairness, it's the first time I've seen so many comments inside an if statement! Think I'll live with the warning (i.e. disable it for that particular file.)
|
|
|
|
|
This is simply ridiculous..
|
|
|
|
|
33 lines long condition in this piece of code is absolutely adorable!
A drunk disassembler would have done a better job generating such code No kidding - recently, I had to restore some source code from a compiled dll, and reflector's result was way more reasonable than this one.
|
|
|
|
|
I've never seen this code before but assume it must be TKSpell. Yes, it's a horribly long conditional, but the code layout and comments make it reasonably clear as to what's happening.
I know that i'm going to offend a lot of people, but a large function is not, repeat not, in itself a sign of bad programming. If the routine does exactly one well defined thing, it doesn't matter how large it is counting lines of code.
And now i hear the refactoring crowd shouting at me. OK guys, you spend your time refactoring. I spend my time producing good solid production code.
|
|
|
|
|
Sam Cragg wrote: ) ) ) ) IHMO this is the best part of it.
Greetings - Jacek
|
|
|
|
|
The layout is not pretty and I would have commented it a lot more thoroughly, but there is nothing wrong with a complex if statement. I know that the refactoring polizei will feel that 1000 statements are better than one but as long as the code is well laid out and well commented (which this isn't), then a single statement can be simpler to follow.
The warning, incidentally, is for the final stanza in the line after the comment // LANG_hu section: spec. Hungarian rule . The compiler is guessing that rv = affix_check(st,i) should be rv == affix_check(st,i)
|
|
|
|
|
Why is it that people keep asking the same questions on the Q/A forums?!!!! It's appalling and tedious the number of people who can't be bothered just to search CP articles and old Q/A's!! The current recurring question appears to be how to send email in C#...can people pleeaasee search!? It's awful practise not to!
P.S. Sorry I had to rant...and CP Lounge is blocked from where IO am atm...
|
|
|
|
|
Yes, I understand you, and many other questions would deserve the standard RTFM reply, but in these cases I am usually happy just downvoting them.
Edit: Thank you. I was just wondering how long would be to get this post downvoted.
modified on Thursday, March 3, 2011 8:41 AM
|
|
|
|
|
Search code-project articles or stack-over-flow << for me, this works in most cases.
there are many dumb people, who don't even search properly. I meet them at my office.
|
|
|
|
|
If they couldn't be bothered to google for answers, do you really think they'll bother to search this site.
They would have to move their mouse all the way to the top right of the menu bar, click, and then actually type in a search. Oh yeah... they would also have to click on the magnifying glass button...
Way too much effort involved...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Yes true but instead they can be bothered to go to the menu bar, click the post question link, type in their question, tag it, write the body (well sometimes they can't be bothered with that ) and then click the post button and then spend ages waiting for an answer...surely searching is less effort?
|
|
|
|
|
No, searching requires at least some thinking, which the worst of them do not want to do. That is why they re-ask the same question when someone only gives them links to descriptions of how to do something. They want complete, fully functional and debugged code.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Very true A bit sad though when you think about it...
|
|
|
|
|
I'm guilty of doing this, admittedly. Or, I'll do a search and can't find it, post the question, and a few hours, search again.
It would be that on the second search I find what I'm looking for... Live and learn, I guess.
|
|
|
|