• Hanzito (unregistered)

    For those not completely up-to-date with modern development acromyns such as KISS, DRY and HATEOAS, CYA is the well known strategy of Covering Your Arse.

  • Farrah (unregistered)

    Why is parse a void function? It this a class method setting some fields, or are there other side effects?

    Also, that "some" scares me, it implies you have a mix of YYMM and MMYY with no way of knowing which is which.

  • Farrah (unregistered)

    Also, no checking of scanf return value, wonderful UB on invalid input

  • retsep (unregistered)

    Variable expiryDate could have two symbols 'dm' or 'md' in the beginning so there would be no guessing. Also, there should be parsing of production date which ought to be used to calculate when product expires. What horrors await there?

  • (nodebb)

    "calculate when product expires." I'm sure someone somewhere has written a ternary that compares individual members of two arrays to determine that.

  • Yazeran (unregistered) in reply to Farrah

    Well it would be rude to not allow the Nasal Demons to come out and play just once in a while right?

    evil grin

    Yazeran

  • Die Kuhe (kein roboter) (unregistered) in reply to Farrah

    I suppose (or hope?) that something happens with the year and month values in the part represented by the "//..."

    For the second matter, I suppose that the format is inverted in "some" part of the program, but they know that this "some" part is executed before calling this parsing functions.

    How many suppositions, for a simple cow... aren't they?

  • Die Kuhe (kein roboter) (unregistered) in reply to Farrah

    This may be important or not, depending on whether the "expiry date" comes from an user (that may enter it wrong by mistake or on purpose), or is known to be correct and meaningful.

    Not checking the results (when you know the input is valid) may be important or not, depending on whether the function is run once in a while, or in a cycle of cycles of cycles...

    As in many cases (not only in programming), the missing context doesn't help. :-/

  • Duke of New York (unregistered)

    I see this all the time in coding interviews. There's a sort of developer who, if code has a bug (even their code) they will never change the buggy code, but just add "fix" around it.

  • (nodebb) in reply to retsep

    expiryDate could have two symbols 'dm' or 'md' in the beginning so there would be no guessing

    There would still be guessing. People would be guessing why you are using d as one of your symbols instead of `y.

Leave a comment on “Going on a teDa”

Log In or post as a guest

Replying to comment #682830:

« Return to Article