Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29428

Re: A good article on java.lang.String best practices

From Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: A good article on java.lang.String best practices
Date 2014-07-29 10:24 -0500
Organization A noiseless patient Spider
Message-ID <lr8eba$88s$1@dont-email.me> (permalink)
References <f645ce00-9672-4c28-b599-3519b5ded480@googlegroups.com>

Show all headers | View raw


On 7/28/2014 10:50 PM, im.manoj.tripathi@gmail.com wrote:
> Here is good article on Strings in Java, of you are a Java developer
> then this article could be helpful to write good and optimized code.
>
> http://www.groupkt.com/post/5bcd8475/javalangstring-tips-and-tricks:-best-java-
>  coding-practices.htm

On point 1: Your discussion of when == works is wrong, completely
ignoring interning or reference equality.

Points 2 and 4 both lack an explanation as to one variant might be 
faster, and perhaps reasons why that one may be slower.

Point 5 contradicts its own pithy title.

Point 7 says "we saved multiple string concatenations." Gee, what do you 
think String::format does internally?

Point 8 is so devoid of content to be useless. (Would it really hurt, 
to, I don't know, give examples of utilities, or link to documentation 
in the first place?)

Microbenchmarks are difficult to write properly in the best of 
conditions, and even the best performance experts would hesitate to 
write one. The vibe I get from the post is that so little effort was put 
into establishing a reasonable microbenchmark that the information 
content contained within is worse than useless.

And there's grammar mistakes up the wazoo (sentences should start with
capitals; "their" is the third-person plural possessive pronoun, not
"there"; several sentences are missing connectives; "flyweight" is a 
single word, not two words).

-- 
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

A good article on java.lang.String best practices im.manoj.tripathi@gmail.com - 2014-07-28 20:50 -0700
  Re: A good article on java.lang.String best practices Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-07-29 08:21 -0400
  Re: A good article on java.lang.String best practices Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-07-29 10:24 -0500

csiph-web