• Prime Mover (unregistered)

    TRWTF is cooking more food than you need in the first place.

  • LZ79LRU (unregistered) in reply to Prime Mover

    To an extent. There is food that can be specifically made to last several days. Soups are a good example. And some dishes are even tastier if you keep them on low burn for days.

    But in general the vast majority of food should indeed be cooked and eaten on the spot and thus produced in quantities no larger than what you can reasonably eat in one sitting.

    And under absolutely no condition ever should cooked food be frozen and thawed. Better to starve than do that.

  • TheCPUWizard (unregistered)

    Feature flags are good - this is NOT a feature flag.

    ps: how can one be sure it was "never in the code base" is someone recording every keystroke on every developers workstation?

  • LZ79LRU (unregistered) in reply to TheCPUWizard

    Revision control.

  • (nodebb)

    And of course, this minor WTF:

            return (Result);
    

    The keyword return is not a function, and doesn't need parentheses.

  • (nodebb)

    Some companies explicitly pay their programmers per line of code. I've seen worse ways to artificially inflate the codebase in a way not too obvious to remove immediately.

  • RLB (unregistered) in reply to LZ79LRU

    And under absolutely no condition ever should cooked food be frozen and thawed. Better to starve than do that.

    Disagree. Dutch pea soup can only be made (remotely well) in amounts too large for one person to eat in one sitting. Therefore, I make one large batch per winter, and freeze it in portions. (Not coincidentally, it is also one of those foods which get better if you leave it for a bit.)

  • (nodebb)

    Sounds like something that was in development at some point, but never finished.

  • Pabz (unregistered)

    The use of the CString class is making me think that this might be MFC, although it's not 100% clear - could be their own CString class as well.

    It seems that AddBcdStrings is taking in LeftString and RightString by value, which could be quite inefficient. It wouldn't surprise me if they are also being passed to IsHexData and ConvertBcdStrToInt64 by value as well. It's just as well this code isn't actually being executed!

  • Pabz (unregistered) in reply to LZ79LRU

    Revision control could help, although it could be that the change to define DO_ALL was never committed, even if the code to use it was.

  • Korrat (unregistered)

    The choice of method names is another weird combination: First, check for a hex string, then convert from a BCD string. Either at least one of the method names is wrong or the method would have an issue if DO_ALL was ever defined.

  • Daniel Orner (github) in reply to LZ79LRU

    Maybe not as definitively as you, but I'm definitely on your side. My wife will perennially make way too much food and then say "But we can freeze it!" and then when it comes out of the freezer it's inevitably watery and stringy and gross. The only thing I've found that freezers legitimately preserve is bread - I put the loaf in the freezer as soon as I bake and slice it and it lasts all week without issues.

    Soup is also not too bad frozen because it's already mostly water.

  • LZ79LRU (unregistered) in reply to RLB

    I would newer freeze it. Refrigerate yes. Soup can last 2-3 days like in a refrigerator just fine. But freezing food outright ruins the flavor and generally turns even the best meal into slop.

    The sole exception to this is freezing stock to use later as a cooking ingredient. That I approve since you'll be using it as a flavor enhancer rather than something you actually eat.

  • LZ79LRU (unregistered) in reply to Daniel Orner

    Out of curiosity just what do you put in bread that makes it last a week?

    Or do you mean last as in not go rotten? Because I find that when I make bread it lasts at most 48h before the flavor starts changing and it goes "stale" making it thus bellow the standard of quality for consumption as bread without additional processing.

    Also, on a non related side note I hold that bread must contain no other ingredients than flour, salt, yeast and water. Anything else is a bread like pastry. And any chemical additives or conservatives are outright forbidden.

  • (nodebb) in reply to Pabz

    Note that if this is MFC, then it's not too inefficient: MFC's CString implement copy-on-write (the CString object itself simply contains a pointer to refcounted data -- set up in a way that makes it compatible with printf())

  • John (unregistered)

    I love how it supposedly takes BCD, checks to see if it's valid hexidecimal data, and then decodes BCD. It should go without saying that valid BCD isn't valid hexidecimal, and visa-versa. These checks make NO sense, never did, and the though process behind them AFAICT is "we need to check something for validity here, but we don't have a proper check function. So instead of putting in the name for a proper check function we haven't written yet, and thus forcing our future self to write it correctly, we'll just plop something in here that will sometimes reject valid data and sometimes pass invalid data, thus making hard-to-replicate bugs that future me won't have a clue about."

    Makes sense, but only if you're TRYING to qualify for this site.

  • DrPepper (unregistered)

    I used to write code that was never code reviewed. And I used to write code that was never tested with unit tests. And I used to write code that was never tested by QA. That was a very long time ago. Now I know better.

    Unless this code was written a very long time ago, the WTF here is that none of these things are in place at this organization; or that they are and failed to catch this.

  • Gearhead (unregistered)

    A nice WTF today.

                    // Count von Count:  Five, five numbers of the beast!
                    Left += 0x0666666666666666;
    

    Judging by the code, what with CString and __int64, it predates the long long int type. That integer literal won't fit in an unsigned long int. Would the Microsoft compiler of its day promoted literals to __int64?

    Also, these are signed integers, so you would check the overflow flag, not the carry flag.

  • Gearhead (unregistered) in reply to John

    I love how it supposedly takes BCD, checks to see if it's valid hexidecimal data

    LOL! It's neither binary-coded nor decimal.

  • (nodebb) in reply to LZ79LRU

    In the early 2000s the cuban government made a push to move everyone away from cooking with fuel (usually gas, kerosene, wood and coal) towards electricity. To that end they subsidized the sale of cheap single electric stoves adquired in bulk from China and as a result access to other means of cooking became very difficult in cities.

    The problem is cheap devices break way too often and the rate at which they broke was way higher than the most pessimistic estimates and as a result there is a shortage of spare parts and many have gone back to cooking with fuel, where it is available. The other issue is that some places only have electricity a few hours a day. Cubans call it "alumbrones" (whiteouts) instead of "apagones" (blackouts), since they might spend more time without electricity any given day. Then add half a year of hurricane season. With some bad luck you'll spend weeks at a time without electricity. Also the average temperature and humidity is so high that food spoils very quickly.

    So what most cubans do? They freeze food when they have electricity for when they don't, because bad tasting food is always better than hunger. And if you're thinking "why don't they just buy food that lasts longer"? That is a first world thought. Cubans joke their country is 5th world rather than 3rd. Humor helps.

  • WTFGuy (unregistered)

    Anyone suggesting that a version control system contains a completely reliable history back to Ye Darke Tymes when Ye Olde Codee was Fryshe has never worked for a company who has gone through two or three version control system replacements during the life of the application in question. Nor for a company which has been bought, fragmented, and sold a time or three, with attendant multiple re-hostings of said application along the way. And of course ever-changing departmental management attitudes to setting and enforcing (hah!) policies for use of the then-current VC system.

    Version control can be really awesome for the last 18-24 months or so. After that it in many (most?) cases starts getting real flaky. For reasons largely unrelated to the technical merits or reliability of the current VC software itself.

  • LZ79LRU (unregistered) in reply to WTFGuy

    I simply assumed from the context of the original post that the author did in fact have access to all the records which is the reason for such a definitive statement.

    After all, if this was not the case the statement would have been something like "DO_ALL, by the way, is not defined anywhere in the codebase. We can't say for sure if it ever was." As opposed to the quite definitive sounding "DO_ALL, by the way, is not now and never was defined anywhere in the codebase. "

  • RLB (unregistered) in reply to LZ79LRU

    I would newer freeze it. Refrigerate yes. Soup can last 2-3 days like in a refrigerator just fine. But freezing food outright ruins the flavor and generally turns even the best meal into slop.

    And for Dutch pea soup, you are simply wrong about that last part.

    Mainly because it's already slop... very, very tasty slop.

  • (nodebb) in reply to LZ79LRU

    But freezing food outright ruins the flavor and generally turns even the best meal into slop.

    Amazing how you can be so thoroughly wrong. I suspect it's more to do with how you, personally, go about defrosting and reheating things that have been frozen. You're doing something wrong, though I don't think I have the cooking skills to debug what it might be.

  • LZ79LRU (unregistered) in reply to dkf

    No, it's just an objective fact that freezing food changes the flavor of it.

    How much this effects you or indeed how much you even notice is of course up to you and how high standards you have for the quality or flavor of the food you eat. The more you care about these things and the more you have, through caring unavoidably trained your body to notice them the more it effects you.

    I doubt that the generic fast food eating american who thinks takeout or microwaved food are a legitimate source of food for the generic day would notice anything. But if you are like me and homecook everything out of only the best ingredients and with only the highest standard of care than the difference is stark and impossible to ignore.

    And before anyone thinks otherwise no, I am not rich. Nor did I ever go a day without eating. But even on the darkest day I'd rather not eat at all than eat stubstandard food. A conviction which I have been forced to test more than once in my life and have always passed.

Leave a comment on “Dining on Leftovers”

Log In or post as a guest

Replying to comment #:

« Return to Article