Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: Re: The greeting code in Java Date: Sun, 19 Jun 2011 21:23:28 -0700 Organization: Canadian Mind Products Lines: 42 Message-ID: References: Reply-To: Roedy Green NNTP-Posting-Host: RCd/Ul4tyxGUBII8WGwa5g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5414 On Sun, 19 Jun 2011 06:05:53 -0700 (PDT), Saeed Amrollahi wrote, quoted or indirectly quoted someone who said : >package Greeting; >import java.io.*; > >public class Main { packages are traditionally all lower case. e.g. "greeting". Further they should be globally unique by including your domain name, e.g. "com.amrollahi.saeed.greeting". That way you can share code with others without worrying about package name clashes. Main is not a very descriptive name for a class. Try "Greeting". The code itself works fine, though it is a "vortope" translation of C rather than idiomatic Java. You forgot to close your stream. An fairly easy extension is a while EOFException loop to handle more than one name. Thank you for compiling and running your code before asking help. So many newbies fail to do that. You also explained what your code was supposed to do. These are lessons that seem almost impossible to get into newbie heads. -- Roedy Green Canadian Mind Products http://mindprod.com One of the great annoyances in programming derives from the irregularity of English spelling especially when you have international teams. I want to find a method or variable, but I don't know precisely how its is spelled or worded. English is only approximately phonetic. Letters are randomly doubled. The dictionary often lists variant spellings. British, Canadian and American spellings differ.I would like to see an experiment where variable names were spelled in a simplified English, where there were no double letters.I also think you could add a number of rules about composing variable names so that a variable name for something would be highly predictable. You would also need automated enforcement of the rules as well as possible.