- 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
Would that be replacing “== 27” with “in (27, 31)”?
Admin
It's times like these that you need to start looking for a new job.
Admin
yeah - push it off to the business in the middle of a divestiture...let me know how that sell goes over...
#MOC
Admin
Should have just added the database field anyways and defaulted it to false. Then additional factories could be handled via a single update query, and the field would be safe from tampering by users
Admin
The boss's HPC said it would be the best way, so now they'll do it the way it should have been the first time. And, the way they just did it will have to be changed to the 'new' way.
Admin
Actually I'd have just implemented it as a list rather than a single factory. But that's just me being paranoid.
Admin
These are the stories I love because I can relate to them so well.
Admin
Yes, let's add another wheel to the R. Goldberg machine
Admin
I see you have discovered the "maintenance" side of our business.
Admin
Harlan knows how to make himself indispensable.
Admin
We're missing how this alt-process was implemented, but my guess is that it was just adding a condition on the factoryID and a condition for the "stop" dates. For a few one-off cases, you could just search for the factoryID of the first sold factory and modifiy the condition and then do the same for the "stop" date conditions. Unless they're creating a new path for each new sold factory, the update process would be a little tedious but not monumental, but that depends on the size of the code-base.
My first thought when he mentioned re-coding everything to add a new field is that they are using "Select *" queries to populate their objects or their objects are not strictly typed but bound to the table structure behind them. Otherwise, you could add the field to the tables behind the scenes and create objects to access the new fields only at the points you need it at
Admin
They probably did and got shot down. Sometimes someone just gets an idea in their head - it must be done this way! - and comes up with rationalizations after the fact.
In at least Python and Javascript,
[27]
is a singleton list containing 27.Admin
No matter what you do, the Right Way to do it is to only have "27" in one place in all the code. Also you should not expect only one factory to be closed, so none of that "THE_CLOSED_FACTORY=27" crap either. Then run everything through a function like "bool IsFactoryClosed() { return factory==27; }", and not only do you only have one place to change, you can actually read what the fuck the code is trying to do.
Admin
Nah, just go into the database and change the primary key of the newly closed factory to 27.
Admin
Reminds me of the IPCs (Inexplicably paid consultants) at my last job. Magic numbers everywhere, couldn't design their way out of a wet paper bag, massive incompetence, the usual.
Admin
It doesn't seem like a WTF to me. Harlan is thinking "hmm, the company is clearly downsizing. What's a way I can make sure my job survives?"
Admin
|No matter what you do, the Right Way to do it is to only have "27" in one place in all the |code. Also you should not expect only one factory to be closed, so none of that |"THE_CLOSED_FACTORY=27" crap either. Then run everything through a function like |"bool IsFactoryClosed() { return factory==27; }", and not only do you only have one place |to change, you can actually read what the fuck the code is trying to do.
This. Why don't we have a like button?
Admin
From the article, it sounds like each factory will have different "closed" states. One indicating that new claims aren't allowed, and one indicating it is completely closed (viewable content only for queries on what claims there were, who worked there, etc.), and of course "not sold". So just an "IsFactoryClosed() method probably isn't enough.
Admin
So you make a single "FactoryClosedStatus()" returning the appropriate closed status.
Admin
Why is everyone calling it "factory closed"? It's "factory sold."
Admin
I'm impressed that this company somehow managed to sell two factories with identical contract terms (or at least close enough that a big sprawling corporate IS system can handle them with identical code). Like they'd at least need different closing dates if the employees had all the same unions and the factories were under the same regulatory regimes, and differences in either of those could trigger special cases everywhere. There's no description of how they've handled even one closing date (other than rolling out ad-hoc production code updates after the fact to each individual software system).
Admin
Why don't you know how to bbcode quote?
Admin
This is the correct usage of the word "close" in this context - the closing date of the contract. The factory is sold on the closing date of the contract.
If this company ever actually closed a factory, instead of selling it, I imagine the rules would be different.
Admin
I'm impressed by the fact that this company was able to sell two factories that had identical contract conditions (or at the very least, close enough so that a large vast corporate IS system could manage the two factories with identical codes).