ccristian / caliper

Automatically exported from code.google.com/p/caliper
Apache License 2.0
0 stars 0 forks source link

CliperMain.main() should take var arg instead of String[] #190

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
CliperMain.main() should take var arg instead of String[]

major inconvenience, you know :=)

Original issue reported on code.google.com by Andrei.Pozolotin on 10 Jan 2013 at 5:08

GoogleCodeExporter commented 9 years ago
better yet, add new main(class, String ... args )

Original comment by Andrei.Pozolotin on 10 Jan 2013 at 5:09

GoogleCodeExporter commented 9 years ago
I'm not sure that we want to encourage this type of manual invocation.  We've 
seen a lot of issues in Google with people that have been doing strange things 
in their main methods that make their benchmarks complex and difficult to 
maintain.

Do you have a particular use case for this?

Original comment by gak@google.com on 10 Jan 2013 at 6:13

GoogleCodeExporter commented 9 years ago
I agree with NOT "we want to encourage this type of manual invocation"

my use case: quick/dirty runs testing to save typing

well, provide it, but mark it @Deprecated and explain why

Original comment by Andrei.Pozolotin on 10 Jan 2013 at 6:17

GoogleCodeExporter commented 9 years ago
Introducing a @Deprecated method to save someone from initializing their own 
array leaves me skeptical.  Still not ruling it out, but not overwhelmed by the 
idea either… 

Original comment by gak@google.com on 10 Jan 2013 at 6:44

GoogleCodeExporter commented 9 years ago
thank you for considering this.

how about introducing new annotation:

@YouWillBeFiredFromGoogleIfYouUseThis

:-)

Original comment by Andrei.Pozolotin on 10 Jan 2013 at 6:57

GoogleCodeExporter commented 9 years ago
The hazard is that varargs allows you to pass nothing, and then people very 
easily forget to pass 'args' through. As they're busily editing their 
benchmark, they keep updating their @Param defaults and such, and sometimes 
never notice that args don't work until later. Their benchmark is checked in 
and people are passing arguments, even --help, and it doesn't work...

I'd like more detail about how it helps your "quick/dirty runs testing."

Original comment by kevinb@google.com on 11 Jan 2013 at 4:21

GoogleCodeExporter commented 9 years ago
instead of 

main(BenchClass.class, "--verbose")

I have to say

main(BenchClass.class, new Sring[]{"--verbose"})

needless clutter.

Original comment by Andrei.Pozolotin on 17 Jan 2013 at 11:39

GoogleCodeExporter commented 9 years ago
I get that part, but not why hardcoding command-line arguments in Java form is 
a useful practice.  It would matter less if there were no downside to changing 
to varargs, but there is.

Original comment by kevinb@google.com on 18 Jan 2013 at 3:08