Time Conversion

  • + 2 comments

    Allison, thanks for the suggestion. Actually I added second 'if' to enhance readability, obviously that can be omitted. You can find a huge debate over the internet upon whether to bracket a single statement or not, so I won't go into that. Perhaps non-bracketing style have come into picture because of people moving out of C/Java style and working with Python/Haskell. Whatever is the reason, everything has its pros and cons. Avoiding it does "no harm"/"good", until you know what you are doing, well, it applies to any piece of code.


    I usually look for an alternate/better solution even after solving the problem. That's why I wanted it to be more readable for someone looking for a different approach. Don't get mad over me because I didn't follow some particular style of coding. By the way, even "strcmp" is not needed that way, just check if t12[0]=='P'. One doesn't code in "CodeGolf" and "Hackathon" alike. Here, I just gave an alternate approach with enhanced readability, if it helps someone, with belief that target audience is intelligent enough to shorten the code. I seriously had no intention to make it "inelegant". Though, thanks again for the suggestions, would surely help someone get better insight :)