by jokiz via jokiz : C# on 12/6/2008 6:19:00 AM
i has been one year since I haven't been posting in this blog, hmmm. wow, time is really that fast. one year and I haven't done much actually, just work and DOTA. Not at all productive and pretty much lagging with the current technologies out there. I don't even had the time to read my tech blog feeds in google reader. Time to catch up (hopefully).
Let's start with a piece of code that I bumped into recently in migrating some of the business rules in our bank application. See if you can easily deduce what the code actually meant and suggest something to make it readable:
bool isReduced = (!isReduced) ? hasExceed : true
some coding guidelines doesn't recommend the use of ternary operators since they find it hard to read. i'd say, not all the time, but the code above had a hard time expressing his intent to me, ;p.
Original Post: tricky ternary operators
The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.