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: Tobias Blass Newsgroups: comp.lang.java.programmer Subject: Re: The greeting code in Java Date: Tue, 21 Jun 2011 07:44:38 +0000 (UTC) Organization: A noiseless patient Spider Lines: 27 Message-ID: References: <3d6aab49-9a4a-4614-af12-bb1c95bebbe7@w4g2000yqm.googlegroups.com> <969l09FjduU8@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Tue, 21 Jun 2011 07:44:38 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="17WgcLqQtdfvz0nzLAsj7w"; logging-data="9662"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18czHBThbwrmIE3kqpHOJDmEPhMtpv512c=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:HUOwdp3ISOVQXVjqrN9mfHMEvZ0= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5459 On 2011-06-20, blmblm myrealbox.com wrote: > In article , > Jeff Higgins wrote: >> >> On 06/19/2011 02:36 PM, Saeed Amrollahi wrote: >> > On Jun 19, 6:31 pm, Jeff Higgins wrote: >> >> On 06/19/2011 09:06 AM, Saeed Amrollahi wrote: >> >> >> >>> What are the problems of my code and how can I write >> >>> a better one. Please throw some light. >> >> >> >> What means better? >> > >> > For example using less abstractions and less involve with Java >> > stream class hierarchy. >> >> For a beginner, learning to write C in Java is unhelpful. > > Even in C one would not be likely to input a string by reading one > charaacter at a time -- in a beginner program at least. > Hmm at least in K&R (the inofficial standard C learning book) you often find while((c=getchar())!=EOF) It's less performant than reading whole blocks but in many cases much simpler (And that's what matters in a learning book)