Best Date Validation Method EVER!!!



  • I have seen quite a few examples of how to validate dates over the years. A lot of them on this site. However, I have a new favorite.
    [code]

    public void validateDate() throws Exception {

    System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");

    }

    [/code]
    Yes, this is running in production.



  • That looks like really bad temp code to indicate that the function isn't quite implemented. I'd guess it never got used and so no one noticed it didn't work anyway.


  • Considered Harmful

    I like how it has no arguments or return value.



  • @mott555 said:

    That looks like really bad temp code to indicate that the function isn't quite implemented. I'd guess it never got used and so no one noticed it didn't work anyway.

    Thank goodness for .NET's [url=http://msdn.microsoft.com/en-us/library/system.notimplementedexception.aspx]NotImplementedException[/url]. Apache commons has it too.


  • ♿ (Parody)

    @dphunct said:

    Yes, this is running in production.
    Does it really ever run? Or is it just dead code?



  • @joe.edwards said:

    I like how it has no arguments or return value.
    Is this in a ConsoleOutputHeading class, by chance?  Because that's about the only excuse I could think of.



  • Looks like it prints a command line to a brainfuck interpreter that does the job.


  • Trolleybus Mechanic

    @dphunct said:

    I have seen quite a few examples of how to validate dates over the years. A lot of them on this site. However, I have a new favorite. <font size="2" face="Lucida Console">
    public void validateDate() throws Exception {
    System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
    }
    </font> Yes, this is running in production.
     

    I don't even see the opening and closing brackets.

    I see January, and 03/07/2007, and 634372097997227500


Log in to reply