Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!kanaga.switch.ch!switch.ch!newsserver.news.garr.it!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: Call by Result References: Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 11 Jun 2011 21:06:32 GMT Lines: 24 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1307826392 tunews.univie.ac.at 5640 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5223 Martin Gregorie wrote: > I think its because GW is using a variant of the so-called Hungarian > Notation which AFAIK is a Microsoft invention, initially applied to C and > C++. > The idea is to make the name of a function or method document the type of > object it returns by prefixing the name with an alphabet soup of > initials, so a function returning a string might be called > sMyFunction(). The catch with it is that, if you need to change the type > of the returned value, you need to change all references to it as well, I wouldn't exactly call that a "catch". If you change the return type of a method, you'd f...ing better have a look at all call-sites ;-) At least, the compiler will help you, if it finds old sGetString() still referenced somewhere. Without changing the name along with the return- type, you *might* not notice all calls, and end up with a runtime-crash. There's an entirely different catch, however, namely that people might change the type but *not* the name, and you end up with the same trouble as without HN, except wrong expectations on seeing sGetString() which maybe has been changed to return an Integer. > e.g if the function should rather return a pointer to the string you have > to rename it to psMyFunction() and then hunt through the source file(s) > changing all references to it as well.