- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Even the compare is not needed. The "checked" is always true so it's enough to look at the "IsFlagged" itself. And it would be more readable too.
Admin
var isFlagged = FilterCheckBox.Checked; FilteredSortedItems = isFlagged ? CurrentItemList.Where(info => info.IsFlagged == isFlagged).ToList() : CurrentItemList.ToList();
Smells like a serious case of over engineering or trying to write clean code without understand what clean code is all about :-)
Admin
I wonder whether a developer was bored one Friday afternoon? Or wanted to drag a job out a little longer so as not to be in the frame for another project for a while? Can't see how this sort of thing is not at least partly deliberate over-engineering for the sake of it.
Admin
The intern needed to do some CS homework, and accidentally committed it.
Admin
@MaxiTB ref
I suspect that could be further simplified to
Admin
The developer was paid by line of code.
Admin
"The developer was paid by line of code." I once had a job where management said they were going to start rating programmers by lines of code produced per day. And I thought, great! I can boost my productivity by that measure easily! No more "x=x+4". Instead I'll write "x=x+1" four times. And loops? No, just copy and paste the same code as many times as you need. I had lots of ideas like that. Sadly, the company never followed through on the policy.
Admin
My guess is that the method was originally intended to be used more generically -- the name suggests that it's for turning the boolean into an array index. But those other users have gone away, and now we're just left with this WTF.
Admin
My guess is that the method was originally intended to be used more generically -- the name suggests that it's for turning the boolean into an array index. But those other users have gone away, and now we're just left with this WTF.
Admin
There are places where equality comparison with booleans is strongly discouraged (possibly places with a strong fortran background), as you should be using logical operations (and, or, xor), which does have some appeal. This looks something like someone trying to get round a restriction like that.
Addendum 2022-03-24 05:02: among other things, it stops people writing if <boolean> == false ...
Admin
Crypto Recovery Services Crypto Recovery Services, Houston, TX. 1 talking about this. How to recover lost, stolen, hacked, forgotten and scammed crypto currencies from fraudulent investment platforms Website: www.cryptoreclaimfraud.com
Admin
I can imagine this method is used to find an index of some element whose position depends on whether or not the checkbox is on. Right now, it shifts on just one position, but this might be different in the past or mah change in the future. Should there be multiple elements displayed before the "Filter", the smart solution with Convert.ToInt would inevitably break.
I do not argue that the original solution is terrible but it is not absolutely pointless.