On 13 Apr 2009, at 14:26, Alexey Zinger wrote:
> Call it what you wish, but I think of it as a situation, where I am  
> taking a step in the direction of obscurity for some specific reason  
> (to me, it's not always a bad reason) and compensate for it with  
> clear and concise comments.  I think it's just realistic -- you  
> can't expect every single API or your own line of code to be  
> completely self explanatory.  It's just a fact of life.  I just  
> looked up some regex examples and came across this:
> (19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])
> Would you prefer to see this in your code with no explanation, or a  
> little line that tells you it's a date matching pattern, or better  
> still, gives you a pseudo pattern or an example of what's expected  
> to match?

Anything that begins with a 19 or 20 is likely to be date related.   
I'd hope for a suitable variable name like validDate or something.

-Dom

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to