Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: StringBuilder Difficulties Date: Mon, 04 Jul 2011 07:52:22 -0700 Organization: A noiseless patient Spider Lines: 54 Message-ID: References: <9744m8FpnhU3@mid.individual.net> <6cqp07tiug2nu8u6ififvvek1694fkpfi1@4ax.com> <976q3jF3etU2@mid.individual.net> <978bv1FnqaU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="32587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e0yZ3AHayeLTlZhQUL6KO0I6rraBer7I=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:aQ4Jy6SMCIORQssDbL1wbGqQR/k= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5849 On Sat, 02 Jul 2011 12:58:40 +0200, Robert Klemme wrote: >On 07/02/2011 02:29 AM, Gene Wirchenko wrote: [snip] >> My tools include manyyears of experience programming. I do not >> think that Java is such a precious snowflake -- the same is true of >> any language -- that I should have to throw all that experience away >> in order to use the language. > >As far as I can see nobody asked you to do that. If adjusting to a new >language's mindset requires you to throw away everything you've learned >so far then you probably better stick with the previous experience and >tools. That will be much more efficient and beneficial. I do not name my variables the way some think I should. I do not use exceptions the way some others think I should. And on and on. There have been some very good posts which I have appreciated. There have been others which were nitpicky and antagonistic. >If, on the other hand, you want to use a new language then you typically >get best results (or results at all) if you adjust to the environment >you find. You may have noticed that your issues with StringBuilder seem >to be quite unique - others posting here do not seem to have those >issues. In my experience this is usually an indication that I am doing >something wrong or haven't properly understood the new environment yet. Well, no, they are not. I had a problem with StringBuilder comparison with a string. I STWed and found a discussion that was originally posted here. Roedy was involved in that discussion. [snip] >> Oh, I asked about that. One apparently can not pass a function >> pointer parameter as in C. The ways that were posted involved lookup >> every time AFIACS and I judged that it might swamp what I was >> measuring (checking if a character were in a set). So, to my chagrin, >> I had to go with cut-and-paste. > >The usual solution in Java is to factor out an API into an interface and >have several implementations of that interface. See Callable for >example - this basically encapsulates a "function" with no arguments and >a single return value: It is horribly verbose. Java: COBOL++? [snip] Sincerely, Gene Wirchenko