Re: [JGIT PATCH v3 20/23] Added the class NoGitRepositoryFoundException.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



söndagen den 8 juni 2008 18.14.00 skrev Florian Köberle:
> Robin Rosenberg wrote:
>  >> +		super(String.format("No repository found for file '%s'",
>  >> +				fileWeSearchedRepositoryFor));
>  >
>  > This is any odd patterrn. Usually we use + to concatenate strimgs.
> 
> Hi Robin,
> 
> I know two good reason why you should use formating functions over 
> string concatenation via the plus sign:
> 
> 1.) formated strings are better translatable. e.g.
> "The string '%s' is more then %s characters long"
[..]
> 2.) Whitespace mistakes are easier to see. e.g.
> (i + "coins") and ("%scoins", i)
> 
> Sure you can make the mistake to provide not enough arguments, but 
> that's not so worse:
> a.) Some IDEs, like Intellij IDEA warn you if you call a formating 
> function with to few arguments.

I'm so ashamed... I used to like printf in C, but I've hardly used it in Java. I
probably will use it more now. Seems Eclipse doesn't check (even GCC
does that).

-- robin

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux