8 ms·
You may want to NOT underestimate one's ability to add TONS of if/elseif/else (or switch/case) statemens in order to put things on track... There are various c
by i0nutzb 4y ago
You may want to NOT underestimate one's ability to add TONS of if/elseif/else (or switch/case) statemens in order to put things on track...
There are various cases of „programming hoorrors” stories where you have a calculator implementation that, instead of doing the ... you know, math, will actually go through all X combinations.
- jstx1 4y agoTrue, as I wrote the calculus example I remembered this post about a medical researcher rediscovering integration - https://news.ycombinator.com/item?id=26384357 https://news.ycombinator.com/item?id=26384357 But it still feels more like unknown unknowns causing you to put in a lot of extra effort; I wouldn't classify these as productivity multipliers.
- hyperman1 4y agoBack in the day, I saw someone ripping a CD to MP3s. He lazily named the first one 1.mp3, the seconde one 2.mp3 etc. After 9, he found he ran out of numbers. So the next one became ... A1.mp3 ! I always wondered, if he thought this trough a little bit further, he'd independently reinvent the arabic number systems.
- brimble 4y agoSome interfaces will sort 10.mp3 so it's directly under 1.mp3, instead of under 9.mp3. This could be a totally sensible hack to evade that problem.
- aix1 4y agoIt even has a name: natural sort order. https://en.wikipedia.org/wiki/Natural_sort_order https://en.wikipedia.org/wiki/Natural_sort_order
- SamReidHughes 4y agoThat's actually not so bad. Physicists in the 20's reinvented matrix math.
- Qem 4y agoInteresting? What would be a good reference on this?
- SamReidHughes 4y agoI most recently encountered this fact in The Man from the Future, a recent biography about John von Neumann. (The first half of it, the first 5 or 6 chapters were good, but it goes off the rails after that.) I think by "physicists" I should have said, Heisenberg. I'm talking about this: https://en.wikipedia.org/wiki/Matrix_mechanics#Heisenberg's_reasoning https://en.wikipedia.org/wiki/Matrix_mechanics#Heisenberg's_... https://en.wikipedia.org/wiki/Heisenberg's_entryway_to_matrix_mechanics https://en.wikipedia.org/wiki/Heisenberg's_entryway_to_matri...
- noduerme 4y agoI just had a recent situation like this which initially presented as a simple calendar / due date list, but then spiraled into some dreaded fuzzy set of if/then cases as the client began to add requirements for due dates of certain items in a certain order that would take priority over other items due on the same date, or missed items, or future items that could be done in advance. After two weeks of increasing horror, and four attempts to write the algorithm, I sent the client something I called the "Blueberry Muffin Problem" email, as a reference to that scene in Casino. But there is no logical way to do this, I said. Anyway. This led to a series of conference calls in which we finally were able to see a clear strategy. End result: 40 lines of immaculately clean code, roughly $10,000 at $200/hr, problem solved. I obviously wasn't paid for writing the code in this situation; it was for spending enough time with the problem to find all the edge cases, and figure out the right questions to ask to get to the solution they needed.
- brianhorakh 4y agoCan you share or summarize the blueberry muffin email?
- noduerme 4y agoUh, if you really want. This is probably boring as fuck until I get emotional around the third paragraph ;) --- I'm putting this down here because, even though it seems obvious, it's not; if you spend 10 or 20 hours really thinking seriously about what happens if people write early reports or late reports - the initial conclusion was just count how many they wrote into how many they sent, and tell if they need to send more, but that's not the way life works. Or people work. And it's going to create impossible bottlenecks if the last report is the most important one. The insight I had and what's going to drive this thing is: How many reports were due since the last one you sent. Again, that seems simple but it's not. Technically it doesn't mean they just skip them; it means if one was due Monday and one Wednesday, and you send one on Tuesday, that covers Monday's report; but if you sent it on Wednesday it covers both, the idea being to discard the missed ones without explicitly saying so, and drive them to do what's important today, and more important if it's the final day. It also covers the situation where they filed Monday's report early, but only if they've filed all the needed reports prior to that; otherwise they'll need another one for Monday. That's why this is so hard. It's not the code. It's the number of possible scenarios. So the rule is, we start counting again from when the last report was written, in terms of priority. And when you're looking at 50 reports a day per franchise, you'd better know what the priorities are. For myself personally, I think this is writing software that will lead to absolute catastrophe. I've always tried to align the way my software works with how I think people will be able to use it, to push them to do the right thing. Anyone can write the software I write, it's the thinking about this process that is extremely difficult if you're dealing with, like, hundreds of [redacted] and thousands of customers spread out over time, and have to figure out how to make reasonable suggestions. This is such a thing. What I'm saying is that this is marching into creating a thing that will cause total chaos and I don't think this is the right way. We have the chance now to re-imagine the frequency and rearrange the expectations of the customers and the expectations placed on the staff, and I think we need to do that. The algorithm you asked for is done, but it will not be good for people. And it is extremely hard to understand, even for me, if you asked me why one should take priority over another, when dozens are urgent on the same day. I wrote an "urgency" algorithm on top of it to try to deduce that. The best I can say about it is that it will cause less misses and damage than any other way of looking at the list, and it took me a long time to get to. But I think you're asking for something that is going to be so inefficient, and create such high customer expectations, it's going to be negative on both sides. The scene keeps going through my head from "Casino", where De Niro tells the chef in the hotel to make sure the same number of blueberries are in every muffin, and the chef just drops his hands and goes, "do you have any idea how long that's going to take?" This is a blueberry muffin situation. We need to think of a better way.