- 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
Frist time I ever heard of extension (been years since I last touched C#), and I wish I hadn't.
Admin
"That should almost never happen" = "It will happen incredibly often, usually in the least expected places and with catastrophic consequences"
Edit Admin
When your part expenses include toilet paper, be prepared to deal with shit.
Edit Admin
@Darren : Indeed. I was going to be more specific, and say that it will happen 99 times out of 100 on a good day, but on a bad day, it will be 100 times out of 99.
Edit Admin
@mynameishidden yeah. In fact, counting toilet paper as a production expense (part of the cost of producing a specific widget) is a fairly serious WTF in its own right. It's an operating expense of the factory, and operating expenses like that are overhead rather than part of the material cost of the widget, and should be accounted for as such.
Well, unless the widgets are, in fact, at least in part made of toilet paper. Like "Timmy the Toilet Paper Man" from Dilbert.
Edit Admin
Particularly if the customer is government, the people who negotiated the contract on the factory's behalf can sometimes get very creative in how they charge the government for things that GAAP would say are overhead. Much of government contracting is driven by purchasing regs that are far from GAAP themselves.
Admin
Sounds like a WPF app to me, which is (or at least should be) all about data binding and automagically synchronizing background and view properties. Having polling in there won't just slow things down - it'll force you to break the entire control logic for that one thing. Fun.
Edit Admin
Not as much of a WTF as you'd expect- I've seen it many times, and it honestly makes sense. Company A may produce widgets, but if manufacturing steps in widget production require highly specialized labor, they often subcontract it out. So the full assembly line may actually be run by many companies, plus many parts might be coming from OEMs. Company A will often like a contract where they don't pay for any of the intermediate steps, and just pay for the final products rolling off the line- let the contractors deal with supply chains and losses during manufacturing, as well as any facility operating costs (like TP in the bathrooms) and just say, "I'll pay $1.00 for every widget that comes off the line and passes QC." But the subcontractors obviously want to make sure that price gives them enough slack to cover losses and supply chain variability (and profit!) so you often get these complex spot contracts that get negotiated weekly or monthly (or in extreme cases, daily!).
Since the contractor needs to put toilet paper in the bathrooms, they need to make sure that $1.00/widget covers the cost of the toilet paper in addition to the soap, the first aid kits, and the material inputs and labor.
Edit Admin
Did you never use LINQ? Cause that was C# 3.0 almost 20 years ago. They are actually really great when used properly.
Edit Admin
"Using the "fun" syntactic sugar made the code more complicated for no benefit."
Only if the IModelType* interfaces all inherit from an interface common with a "GetChangedIndicator" method. Otherwise you still need to make the cast and depending on complexity having the process in a single extension method might be better than duplicating the logic in every class implementing from the interface.
"What if an item implements more than one of these interfaces? What if the extension methods disagree on if the item is changed?"
It's a change detection mechanism so use OR instead of AND because you want to know when something changed, regardless of the rest of the checks returning false.
Admin
Despite their name, extension methods are NOT meant to model extension in an object oriented model - quite the contrary. If used properly, they are a great tool, but you should never rely on them to build interfaces, inheritance structures or the like.
Edit Admin
Regardless, it's still overhead, and not part of the cost of making a widget(1). (And why does the contractor pay for TP that's in the toilets of the main manufacturer's factory?)
Even if it's still "necessary" to make the contractual arrangement work, that doesn't prevent it from being a fairly serious WTF. All it does is move the "seat" of the WTF.
(1) Unless the widget in question is a model of Timmy, of course.
Edit Admin
My guess is that this was a "cost-plus" contract with the DoD or other gov't agency, and yes these customers do go into excruciating deetail before approving the overhead rates.
Edit Admin
Extensions are a great feature and they're working on extending them (pun intended) further. It's just that they're used incorrectly in this code.
Admin
Not your first rodeo, eh?
Edit Admin
Leaving the economics of "passing the cost to your customer" aside, this actually sounds like a very interesting project to work on. I'm not saying it's a bliss, just interesting and hard enough to make it worth it.
Edit Admin
I'm also slightly disappointed that I'm the first to mention https://thedailywtf.com/articles/on-systemic-debt from 2020...