• Populus (unregistered) in reply to amischiefr
    amischiefr:
    John Whittet:
    Wait, that table contains every possible permutation of mods? *facepalm*
    Hopefully this is because when it was first developed there were strict guidelines on what series of mods were available so as to restrict certain combinations. Hopefully...

    Exactly ... this is more or less the right solution if only certain sequences of mods are permitted.

  • Zapakh (unregistered) in reply to Kermos
    Kermos:
    W,T,F|W,T,F W,F,T|W,T,F T,F,W|W,T,F T,W,F|W,T,F F,W,T|W,T,F F,T,W|W,T,F

    WTF FTW indeed!

  • John Winters (unregistered) in reply to DLJessup

    Even more than 2^45, because there are different ways of entering the same combination. The reasoning above only considers cases where all the steps are entered separately, but if for instance we had:

    1,2,3,4,5,6

    then the same combination could be entered as:

    1-2,3,4,5,6 1-3,4,5,6 1-4,5,6 1-5,6 1-2,3-4,5,6 1-2,3-4,5-6 1-2,3,4,5-6

    etc, etc...

    And each of these needs its own row in the table. The total number would be quite a lot more than 2^45.

  • Tom (unregistered) in reply to Populus
    Populus:
    amischiefr:
    John Whittet:
    Wait, that table contains every possible permutation of mods? *facepalm*
    Hopefully this is because when it was first developed there were strict guidelines on what series of mods were available so as to restrict certain combinations. Hopefully...

    Exactly ... this is more or less the right solution if only certain sequences of mods are permitted.

    Only if the table also included the name, employee ID, and date of approval. If this is in fact a system to prevent unapproved mods then you need to be able to audit it. My money's on the WTF.

  • (cs) in reply to John Winters
    John Winters:
    Even more than 2^45, because there are different ways of entering the same combination. The reasoning above only considers cases where all the steps are entered separately, but if for instance we had:

    1,2,3,4,5,6

    then the same combination could be entered as:

    1-2,3,4,5,6 1-3,4,5,6 1-4,5,6 1-5,6 1-2,3-4,5,6 1-2,3-4,5-6 1-2,3,4,5-6

    etc, etc...

    And each of these needs its own row in the table. The total number would be quite a lot more than 2^45.

    No, it wouldn't. You're forgetting that this is an in-house, custom development, and that if you want records added to the table, you have to ask someone to do it for you. The reply, for each of the combinations you list, would be to "just type 1-6."
  • random.next (unregistered) in reply to rpjs
    rpjs:
    We need a full list of every single aviation company that uses Gary's company for its maintenance, so we know who not to fly with.

    (except of course I'm sure all the others have similar WTFs too)

    Read again, it's mostly just multimedia equipment. Besides, the actual work on the equipment is the way it should be (well, that's assuming the "specialists" didn't make any typos when typing all those numbers). :-)

  • (cs) in reply to Jess Me
    Jess Me:
    DLJessup:
    Bob is correct, there are 2^45 possible combinations of 45 things here. If you look at the example, the steps are entered in increasing numeric order
    So you've been able to deduce the full business requirements after viewing 17 examples? (Well 16 and a half but we won't quibble.) Without ever even talking to a single user?

    Guys like you make the baby Jesus cry, and planes fall burning from the sky. (Which the baby Jesus is mysteriously unable or unwilling to prevent. Hmmm...)

    Well, it's a sort of hideous multi-dimensional WTF, isn't it?

    (1) FAA regs. There may be a good reason why these apply to "multimedia" components, but I'm not convinced. Could well be pointless red tape. (2) Lots of ripping "warranty invalidated" panels off. Given the general ambience of the story, I'd bet that the owner of the warranty isn't the repair service company. (3) Oracle 11i. Well, we'll get to that. (4) 'The field accepted "shorthand" input.' So presumably 'the doohickey' in charge of 'the field' can perform simple validation and normalisation. It's not like turning "1-6" into "1,2,3,4,5,6" is an especially burdensome task. (5) Why is any of this at all being done in the database?

    Really, I swear, the sort of morons who buy Oracle 11i for applications like this make junior PHP hobbyists look like Gurus. If there really are dependencies between the steps, or even the ordering of the steps, then this is a perfectly sensible use of a database (only minus the actual logic). Exactly what benefit is derived from a "one validation fits all" massive denormalisation into a single table with a single column of machine-unfriendly -- and user-unfriendly; what happens if I prefer "1-4,5-6"? -- gibberish is ... aak, the bats! they're swooping again!

    Of course, as usual, half the important details have been elided for clarity, but I'm at a loss to see how any of this makes sense.

    And the real WTF, the true WTF, the absolutely goddamn inevitable WTF with a system like this, is

    "every now and then you come across a mod level that hasn't been entered"
    . Well, yes, I imagine you would.

    In which case you have three choices:

    (1) Rewrite the goddamn application so that it makes sense. Heck, you've got Oracle 11i. Use (shudder) Java, if you feel you have the need. (2) Keep with the current system. At least it requires manual intervention from one of three people who are liable to be sued when things go wrong. (3) Auto-add each new mod.

    W-T \wH\w \w+CK?

    Once you've got down to 0-normal form, I didn't think it was possible to go lower.

    I was sadly misinformed. By the way, is that an African plane falling burning from the sky, or the European kind?

  • Just Another WTF (unregistered) in reply to pink_fairy

    Actually this sort of thing could be a feature. Instead for writing boring '1-4,7' thingies in the edit box you could write 'waffles' and then get your buddy in IT to add the line in the table so 'waffles' turns into '1,2,3,4,7' and 'rabbit' becomes '1,2,3' heck Tom over there can get 'jupiter XY' to be '1,2,3,4,7' too just to add more excitement to the system.

  • Anon (unregistered)

    This place is so flippin' mod biased...there's never any mention of rockers! I'm gonna go ride my scooter off the Cliffs of Dover now...

  • (cs) in reply to Anon
    Anon:
    This place is so flippin' mod biased...there's never any mention of rockers! I'm gonna go ride my scooter off the Cliffs of Dover now...
    I don't remember Harry Webb featuring in that film. Is there a Director's Cut that features a bus plunging on to the rocks below while Mr Richard caterwauls "We're all going on a summer ... AAARGH!"

    If so, I want the link on YouTube. Hell, my mother wants the link, and she's been dead for three years.

    We're not much a Cliff Richard family, us.

    BTW Rocker+1 that comment, my man.

  • Shambo (unregistered)

    My co-workers gave me a weird look when I just said "Noooooo" in sad disbelief.

  • JohnB (unregistered)

    A quick scan of the comments suggests to me that the solution is not as big a WTF as it first seems.

    There may very well be selected combinations of mods that cannot be performed during the same service call. In this case, you would need to build a table of "if I am doing this and this and this then I cannot do that or that or ..." Well, you get the idea.

    This kind of knowledge is specialized and, in a small shop, that kind of knowledge might be known by only, say, 3 specialists. The effort to develop a rule-based algorithm might very well be non-trivial given the universe of possible combinations.

    So, instead of building in all the logic to handle which mods can/cannot be combined, you build in logic (a simple table lookup) that accepts only previously approved combinations. All other sequences need validation and confirmation by the SMEs.

  • My Name (unregistered)

    Brilliant case of job security

  • (cs) in reply to ideot - that's me
    ideot - that's me:
    jimlangrunner:
    Code Dependent:
    What we need on TDWTF is a similar method of selecting from a table of all possible comments. We could just enter a number and it would select the comment and insert it for us.

    Of course, we all know what the first entry in the table would be...

    What would that be? Does it have anything to do with Irish Girl?
    And a wooden table?

    Hot.

  • (cs) in reply to JohnB
    JohnB:
    A quick scan of the comments suggests to me that the solution is not as big a WTF as it first seems.

    There may very well be selected combinations of mods that cannot be performed during the same service call. In this case, you would need to build a table of "if I am doing this and this and this then I cannot do that or that or ..." Well, you get the idea.

    This kind of knowledge is specialized and, in a small shop, that kind of knowledge might be known by only, say, 3 specialists. The effort to develop a rule-based algorithm might very well be non-trivial given the universe of possible combinations.

    So, instead of building in all the logic to handle which mods can/cannot be combined, you build in logic (a simple table lookup) that accepts only previously approved combinations. All other sequences need validation and confirmation by the SMEs.

    No, it's still a huge and hairy WTF.

    (I was wrong, btw:) The database table holds two columns: one contains "shortcuts" and the other "expansions." Now, I've actually written this in Perl once, and it's not as easy as it sounds ... if you want to get it right. I mean, it's about two hundred lines of Perl.

    Or two fucking stupid columns. Plus about a quarter inch for any other columns with really narrow column names.

    Look. It's simple. Only one column is necessary, no matter how brain-dead this application may be. Can you guess which column that might be?

    So you go with the simple solution: a list of ordinals. Jeez, even Access can manage this (single-threaded). But, let's consider your proposition first.

    Let's assume the model is "disassemble ... spray miracle unglue ... remove chip ... replace with new chip ... spray miracle reglue ... reassemble."

    That would be about it. I don't see any PhD Electrical Engineering stuff going on here. You've got preconditions, you've got actions, you've got postconditions. You also have dependencies on other components/procedures, which ought to be trivial to model for something that sits in a recess in the back of the seat in front, for God's sake.

    I see this as a decision tree about yay deep by hoo wide, where (yay < limit) and (hoo < limit) and (limit ~ 10). Basically, a sparse matrix with a built-in state-machine. Not too difficult to implement for the average Pooh Bear in 1970. Possibly too difficult for the idiots we have using things like Oracle 11i these days.

    Oh, and if it is too difficult? Why would you rely on Los Tres Supremos to get it right manually on a bad hair day?

    Or maybe that's why they don't answer their emails any more ...

  • Sa (unregistered) in reply to pink_fairy
    pink_fairy:
    JohnB:
    A quick scan of the comments suggests to me that the solution is not as big a WTF as it first seems. [...]
    No, it's still a huge and hairy WTF.

    [... Some text in pseudo-english that praises state tables, Perl, decision trees, and the 1970's snipped...]

    Damn! "Add a row to a database table" looks better and better all of the time...

  • Another_Jack (unregistered)

    TRWTF is why you all are debating the best way to code a solution when it's obvious:

    "the field accepted "shorthand" input to represent a range of numbers"

    ... change the field to diable "shorthand" input. A few extra keystrokes won't kill them and compared to everyone stopping what they're doing every time someone comes up with a new permutation it would probably save time in aggregate.

  • (cs) in reply to Sa
    Sa:
    pink_fairy:
    JohnB:
    A quick scan of the comments suggests to me that the solution is not as big a WTF as it first seems. [...]
    No, it's still a huge and hairy WTF.

    [... Some text in pseudo-english that praises state tables, Perl, decision trees, and the 1970's snipped...]

    Damn! "Add a row to a database table" looks better and better all of the time...
    Accept my condolences. I didn't know you were a native Klingon speaker.

    I assume you have some sort of psychological problem with state tables and decision trees. You can leave me with the Perl and 1970s horror.

    Yes, perhaps now is a good day to die.

    Addendum (2009-04-23 18:03): PS, it's a "state machine," not a "state table," you cretin. I took your word for it, because your Quotez Skillz are sadly deficient and I didn't want to draw attention to the fact in case your sophomore year supervisor was checking in.

    There is a fairly important difference.

  • Monday (unregistered)

    Wait, I can fix it!

    if(inputValue == "1"){
     dbInsert("1");
    } else if (inputValue = "1-2") {
     dbInsert("1");
     dbInsert("2");
    } else if (inputValue == "1,2,3-6) {
     dbInsert("1");
     dbInsert("2");
     dbInsert("3");
     dbInsert("4");
     dbInsert("5");
     dbInsert("6");
    } 
    .....<snip>........
    } else if (inputValue == "1-6, 8-21, 22-26"){
    
    }
    

    It was too confusing before, I couldn't follow the logic.

  • Motown (unregistered) in reply to Sa
    Sa:
    pink_fairy:
    JohnB:
    A quick scan of the comments suggests to me that the solution is not as big a WTF as it first seems. [...]
    No, it's still a huge and hairy WTF.

    [... Some text in pseudo-english that praises state tables, Perl, decision trees, and the 1970's snipped...]

    Damn! "Add a row to a database table" looks better and better all of the time...

    I'll say. This is more of a baby WTF that grew over time.

    At the start it was probably the easiest solution, especially since the guy programming it probably gave up on the always illogical business logic that the supervisors use.

    pink fairy wants to spend a few months analyzing the requirements, while the original dude spent all of a day from bright idea to code complete.

    You've also got to think about how other systems consume data. Perhaps some braindead report writer thing can't actually extract 1-3,5 to be 1,2,3,5 so the table of possible combinations also has to store it.

    I only bring these up because most of the time the wtf's in your system are a result of illogical business logic, and other enterprisey apps. At least we can be certain they'll never develop the world domination robots.

  • (cs) in reply to Just Another WTF
    Just Another WTF:
    Actually this sort of thing could be a feature. Instead for writing boring '1-4,7' thingies in the edit box you could write 'waffles' and then get your buddy in IT to add the line in the table so 'waffles' turns into '1,2,3,4,7' and 'rabbit' becomes '1,2,3' heck Tom over there can get 'jupiter XY' to be '1,2,3,4,7' too just to add more excitement to the system.
    Well, you've got a point there. Although it's not really secure, is it? I mean, the least you can do is to store it in Base64 ...
  • Matt (unregistered)

    $user_input

    SELECT sequence FROM lookup_table WHERE shorthand = '$user_input' AND status = 'live'

    if(num_results < 1){

    // Code to parse string goes here:
    // can't be bothered writing it now. too much wine on board
    
    $parsed_result
    

    // generate user alert here // Something along the lines of: // 'Please contact a service engineer to add your job request'

    //Charge 3 hours' work

    INSERT INTO lookup_table (shorthand , sequence , status) VALUES ($user_input , $parsed_result , 'pending') } else { // Continue program logic here. }

    .. Sounds like a great gig to me.

  • Americium (unregistered) in reply to Better order another petabyte of disk
    Better order another petabyte of disk:
    ALL mods? I don't remember my combinatorics too well but isn't the number of combinations of 45 things like way up there, like 2^45? Better order some more disks.

    There are 45 factorial permutations of just listing numbers 1 to 45. That doesn't even count the ranges, like "2-3".

    Also, 45! is definitely much greater that 2**45 power, since each term in the product, except one & two, are greater than two. There are 45 terms in both products.

    Computers do math. so, programmers should know math. That's a common WTF.

  • Jess Me (unregistered) in reply to Americium
    Americium:
    Computers do math. so, programmers should know math.
    (Mandatory car analogy) Cars consume gasoline. So, drivers should drink gasoline.

    C'mon, one of the nice things about having a computer is it can do the math for me! All that math they made me learn to get my degree... never used a bit of it in over 25 years of software and database development.

  • Hulser (unregistered)

    It seems to me that if the whole parse-a-comma-delimited-list-of-numbers-and-numeric-ranges alternative solution is itself a WTF.

    Even if there is some kind of restriction on the valid combinations, why wouldn't you just design the front-end so you could click on the mods you wanted in the set? You could use a checked list box or a Left-list/Add/Remove/Right-list style form. This way you could allow the user to see the actual mod names and not have to mess around with the numbers.

    I can't think of any time that I've seen a comma-delimited list stored in a database where there hasn't been a much better solution.

  • SurturZ (unregistered)

    I know! They could write a routine that automatically goes through each possible permutation to pre-load the table!

    Err.. waitasec...

  • Jesse (unregistered)

    Well, one the plus side, he's got a few thousand unit tests already written for his new function.

  • Slicerwizard (unregistered) in reply to Jesse

    And he'll probably find a few errors in those tests...

  • (cs) in reply to pink_fairy
    Just Another WTF:
    Actually this sort of thing could be a feature. Instead for writing boring '1-4,7' thingies in the edit box you could write 'waffles' and then get your buddy in IT to add the line in the table so 'waffles' turns into '1,2,3,4,7' and 'rabbit' becomes '1,2,3' heck Tom over there can get 'jupiter XY' to be '1,2,3,4,7' too just to add more excitement to the system.
    I got in touch with my buddy in IT and now 'Remove Rickrolling interrupt hack' maps to '1,2,3,4,7' as well.
  • (cs) in reply to Americium
    Americium:
    Better order another petabyte of disk:
    ALL mods? I don't remember my combinatorics too well but isn't the number of combinations of 45 things like way up there, like 2^45? Better order some more disks.

    There are 45 factorial permutations of just listing numbers 1 to 45. That doesn't even count the ranges, like "2-3".

    Also, 45! is definitely much greater that 2**45 power, since each term in the product, except one & two, are greater than two. There are 45 terms in both products.

    Computers do math. so, programmers should know math. That's a common WTF.

    Well ... all that would be relevant if all 45 steps were to be performed on all mods, and the only difference between them was in the order in which they were to be performed. I leave it as an exercise for you to determine how many of them would have "Close field-serviceable covers" immediately followed by "Open field-serviceable covers".

    What's going on here is that there are 45 different tasks that may or may not need to be performed for any given mod, and only a very limited amount of leeway in the order in which those tasks could be performed (exactly how many possible permutations there are for each mod - how many topological sorts are admitted by the dependency graph - is of course something that would come from the realms of business logic).

  • Jay (unregistered)

    I wonder how many entries are already in the table. And how many of them contain errors. I'd bet that somewhere in there, there's something like "1-9" maps to "1,2,3,4,5,6,7,9". And then somebody gets the wrong list of steps, and no one can figure out why.

    Note to those saying this may actually be a good design if the requirement is to limit the set of legal combinations: The story started off with the requirement that new combinations be "auto-added". So the whole point is that there is NOT a requirement to limit the combinations.

  • Jay (unregistered)

    On my present job, I recently commented that I was impressed how the original authors of a certain software package we are using managed to get such a complex product to work through sheer persistence and hard work, despite their total lack of skill and talent.

    I'd say the same thing applies here. Can't get a 20-line function to work? No problem. Just hand-type a few thousands rows into a database. I guess it's better than giving up in despair.

  • Jay (unregistered) in reply to jimlangrunner
    jimlangrunner:
    Code Dependent:
    What we need on TDWTF is a similar method of selecting from a table of all possible comments. We could just enter a number and it would select the comment and insert it for us.

    Of course, we all know what the first entry in the table would be...

    What would that be? Does it have anything to do with Irish Girl?

    What a great idea! Just have a list of common comments that users can select from. Think how much time it would save.

    1. First!

    2. The real WTF is using VB.

    3. Irish Girl!

    4. Wooden table!

    5. This story is obviously fake because no rational human being would do any such thing.

    6. If we make a few additional assumptions what the programmer did here is completely valid.

    ... and maybe a dozen or so more.

  • Jay (unregistered)

    Going by the examples, it appears that the numbers must always occur in order, that is, 1,2,3,4,5 is valid but 2,4,3,1,5 is not.

    Given that, the correct total count is 2^45. Each of the forty-five numbers may or may not appear, but the order is fixed.

    45! would be the correct total if all 45 always appeared, but they could come in any order and the order is relevant. That is, there are then 45 choices for the first number, 44 remaining choices for the second, etc.

  • hey persto! (unregistered)

    As has been stated already, these are not just random numbers, they represent real steps in a process which must be followed.

    Presumably there are many dependencies between the different steps thus:

    a) limiting the number of permutations b) requiring some form of validation

    Having a pre-populated list like this could make sense, particularly if there is code which maps particular sequences to something more meaningful. e.g. rather than showing 1-5,7,12-14,18 on the front end, maybe this sequence could be mapped to "Standard Engine Repair/Service" or whatever, which again could benefit from a table to validate against (but would presumably have a name column here).

    Having said this, it is a pretty poor solution and suggest that either the designer had an IQ of 5, or the requirements initially only involved 3 possible steps and the designer hadn't accounted for growth.

  • (cs) in reply to Jack
    Jack:
    rong1982:
    <snip garbage>

    Ok...wtf is a shade sail?

    What, couldn't you figure it out from the context? It's a sail that provides shade - kind of like a fabric patio.

  • (cs) in reply to Jack
    Jack:
    Ok...wtf is a shade sail?
    It's a solar sail that works in the dark.
  • David (unregistered)

    Ah, yes, the kind of solution that makes you want to cause physical violence to it's creator, simply because justice requires that somebody that incompetent also be in pain.

  • C (unregistered) in reply to galgorah
    galgorah:
    I hope they never try and do select * from all_mods.
    Umm... Gary did just that... You can clearly see the "filter" in the screen-shot.
  • Alexander (unregistered)

    I don't consider this a WTF. There is probably only a very small number of sequences valid (in the sense of "You are still allowed to fly the A/C afterwards"). And the rules to determine the valid sequences are probably somewhat complicated. Thus a field validation would be a disatrous big piece of code with rules, exceptions, exceptions of the exceptions, ... So it's perfectly reasonable to outsource the real field validation to the most effective device to do this (the human brain of somebody understanding the A/C maintenance process) and to cache the results of this validation in a list.

  • Sgeo (unregistered) in reply to Alexander

    Ok, but then why doesn't it just expand the shorthand and check to see whether the final expansion is in the table?

  • tragomaskhalos (unregistered) in reply to Jay
    Jay:
    I wonder how many entries are already in the table. And how many of them contain errors. I'd bet that somewhere in there, there's something like "1-9" maps to "1,2,3,4,5,6,7,9". And then somebody gets the wrong list of steps, and no one can figure out why.
    Exactly what I was thinking - Sod's law dictates that there is *bound* to be an error somewhere in that data. The only way to avoid it would be to have code to do the conversion automatically ... in which case just put that code in the app and dispense with the stupid table already !
  • (cs) in reply to Alexander
    Alexander:
    I don't consider this a WTF.
    Where exactly do you work? I want to make sure that we never ever consider outsourcing anything your direction. (Conflating validation and shorthand expansion...? Oh dearie dearie me.)
  • (cs) in reply to hey persto!
    hey persto!:
    e.g. rather than showing 1-5,7,12-14,18 on the front end, maybe this sequence could be mapped to "Standard Engine Repair/Service" or whatever, which again could benefit from a table to validate against (but would presumably have a name column here).
    I can actually see that as a way for this to end up being created. The idea was to have mappings like "Standard Engine Repair/Service" => 1,2,3,4,5,7,12,13,14,18; the desire for abbreviations like to "1-5,7,12-14,18" came along so they were added; and then it was decided that "Standard Engine Repair/Service" was far too vague a statement of what the mod actually was and - after deciding that "1-5,7,12-14,18" was much more accurate anyway - it was dropped.
  • Required for Anonymous Users (unregistered) in reply to Watson
    Watson:
    Just Another WTF:
    Actually this sort of thing could be a feature. Instead for writing boring '1-4,7' thingies in the edit box you could write 'waffles' and then get your buddy in IT to add the line in the table so 'waffles' turns into '1,2,3,4,7' and 'rabbit' becomes '1,2,3' heck Tom over there can get 'jupiter XY' to be '1,2,3,4,7' too just to add more excitement to the system.
    I got in touch with my buddy in IT and now 'Remove Rickrolling interrupt hack' maps to '1,2,3,4,7' as well.
    Does 'luggage code' map to 1,2,3,4,5?
  • Rocketeer (unregistered)

    There is one other reason why this might have been done, that I don't think anyone has mentioned yet...

    You see, the user interface there looks a lot like Oracle Applications, rather than just the Oracle Database. If that's the case, then the original "Developer" probably was just a techie who performed the initial install and configuration of the application.

    The standard features of Oracle Apps lets you specify a lookup table for a field, but it doesn't let you specify a custom PL/SQL function. This means the original techie had two choices:

    1. Change the source code of a (very expensive) third party program (Oracle Apps) to allow validation using a function.
    2. Provide a lookup table, and get someone to maintain it

    Of course, the correct solution (without modifying the Oracle Applications code) is to add an "On UPDATE" trigger for the field with the expansion function - but that still probably sounded too much like "customise 3rd party app" to a manager somewhere!

  • (cs) in reply to Monday
    Monday:
    Wait, I can fix it!
    if(inputValue == "1"){
     dbInsert("1");
    } else if (inputValue = "1-2") {
     dbInsert("1");
     dbInsert("2");
    } else if (inputValue == "1,2,3-6) {
     dbInsert("1");
     dbInsert("2");
     dbInsert("3");
     dbInsert("4");
     dbInsert("5");
     dbInsert("6");
    } 
    .....<snip>........
    } else if (inputValue == "1-6, 8-21, 22-26"){
    

    }

    It was too confusing before, I couldn't follow the logic.

    This needs to be redesigned to use the for ... case pattern!
  • Anonymous (unregistered)

    I don't see the problem, it's only 35,184,372,088,832 rows. I'm sure there's no better way to do this.

  • Hulser (unregistered) in reply to Alexander
    Alexander:
    I don't consider this a WTF. There is probably only a very small number of sequences valid (in the sense of "You are still allowed to fly the A/C afterwards"). And the rules to determine the valid sequences are probably somewhat complicated. Thus a field validation would be a disatrous big piece of code with rules, exceptions, exceptions of the exceptions, ... So it's perfectly reasonable to outsource the real field validation to the most effective device to do this (the human brain of somebody understanding the A/C maintenance process) and to cache the results of this validation in a list.

    To those people who are suggesting that the design is intended to restrict the options to valid combinations, I think you missed something in the first sentence of the post. The guy was hired to implement an way to "automatically add mods". If the business process was that some person reviewed the new combination to make sure it was valid, they wouldn't be adding a feature to automatically add any new user-entered combination to the look-up table.

  • Pedant (unregistered) in reply to Americium
    Americium:
    Better order another petabyte of disk:
    I don't remember my combinatorics too well but isn't the number of combinations of 45 things like way up there, like 2^45?

    There are 45 factorial permutations of just listing numbers 1 to 45. That doesn't even count the ranges, like "2-3".

    Also, 45! is definitely much greater that 2**45 power, since each term in the product, except one & two, are greater than two. There are 45 terms in both products.

    Computers do math. so, programmers should know math. That's a common WTF.

    Combinations aren't the same as permutations. That's a common WTF, and programmers should know math. 2^45 is correct for the number of combinations of 45 items.

Leave a comment on “The Mod Out System”

Log In or post as a guest

Replying to comment #:

« Return to Article