The C printf way is  very primative  .. no new   languages have  used it in
ages and even C++ tried to replace it with cout and overloading .

I prefer the Java  /C# way  which is best from a coding simplicity and
safety point of view but can handle different cases.

stream.Write  ( str1 + str2 +string3)   ( you can go Console.WriteLine or
File  but these use a stream underneath so i dont think it would make a
huge difference in performance )

I dont like   print (str1 , str2 ,str3 ) as much   because  its not as
 obvious what the method does  eg  in C#  if str1+str2 ..etc etc is too
slow  in a big loop you go to

var str =string.Format ( "This is a long string with many  inserts {0} at
different points {1} , val0 , val1 ...) ;
stream.Write  (str);

and if that is still too slow use stringbuilder to write direcly to the
stream.
and if that is still too slow build your own char array


It may be needed for the lib to give ok performance but i would call it
somehing obscure like internal_print so its not the default option for
every  c programmer ..the default / easiest option needs  to be the easiest
and safest one to program .. which c printf style is not..
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to