[haiku-development] Re: printf-convention BString filler

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 23 Feb 2011 21:04:22 +0100


The strings used in the current ReplaceAll system are much better in
this aspect.

So I'd like to keep this syntax for the string, maybe something like :
string.ReplaceFirst("%A", 1, "%B", 2, "%C", 3);

Just a my personal meaning: As a coder I prefer 1) one system call instead of the dozen ones; 2) clean and compact code; 3) code taking less CPU resources. So the multi-Replace way is not a acceptable solution. All those replacements should be performed behind the scene, IMO.

It is about as CPU intensive as printf parsing. It brings more readability and safety. It's only one line more than printf, which, with our 80 char limit, isn't going to be actually a line more.
I think all these benefits are worth an extra call ?

--
Adrien.

Other related posts: