Originally posted by Amit A. Patil:
Case 2 is always good from maintenance and support point.
When some other developer is looking at your code there makes it easier for hiom if there is a single return in the method
Originally posted by Rahul Bhattacharjee:
I will go with Case II.I always prefer single return point for methods.
Originally posted by Rahul Bhattacharjee:
Would you like modify a function with 10 exits/returns ,
knowing the fact that there are no JUnits for unit testing that piece ?
Originally posted by praveen balaji:
As I mentioned above, the question is about performance.
Just for the record, there are several stylistic reasons for and against the use of "guard code" (Case 1). However, I'm interested in the performance implications.
Originally posted by Rahul Bhattacharjee:
To my best of knowledge it has got nothing to do with performance.
Just curious to know that what made you think that it has something to do with performance.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.