tag:blogger.com,1999:blog-7290642316743338665.post6016294044228100801..comments2023-09-20T05:23:44.886-05:00Comments on behind the times: How it Works: Groovy Default Parameter ValuesHamlet D'Arcyhttp://www.blogger.com/profile/04008870357169725586noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7290642316743338665.post-77182337739286664982010-02-22T21:21:52.468-06:002010-02-22T21:21:52.468-06:00This comment has been removed by a blog administrator.木須炒餅Jerryhttps://www.blogger.com/profile/11813785579307536291noreply@blogger.comtag:blogger.com,1999:blog-7290642316743338665.post-86857151297569061972009-05-26T08:27:55.417-05:002009-05-26T08:27:55.417-05:00I use default parameters a lot in my test tree, bu...I use default parameters a lot in my test tree, but use it rarely in my source tree. So I think I agree with you. I think production source meant to be reused by others benefits from being explicit about things, while it's not as important in the tests.Hamlet D'Arcyhttps://www.blogger.com/profile/04008870357169725586noreply@blogger.comtag:blogger.com,1999:blog-7290642316743338665.post-41189663879998635782009-05-24T21:45:21.256-05:002009-05-24T21:45:21.256-05:00Interesting post, I like to see this kind of detai...Interesting post, I like to see this kind of detail and have used javap for this kind of thing in the pass. I'll have to give the AST browser a try in these situations, thanks.<br /><br />That also explains why you can only give default parameters to the final arguments in a method and not the first arguments.<br /><br />Funny that you should mention Clean Code too. I just reread a big chunk of it over the weekend and have been thinking about the section related to method naming and function parameters. <br /><br />After reading that section, I think I'm less likely to actually use default parameters than I have been in the past. <br /><br />I'd be more likely to create an explicit method (greetWorld()), especially in a public API. <br /><br />(I know the point of your article was to show how the AST browser is a good tool for peeking into class files and not the use of default parameters, don't mean to derail :)Anonymousnoreply@blogger.com