Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: Using this Date: Fri, 20 Nov 2015 22:41:29 -0000 (UTC) Organization: A noiseless patient Spider Lines: 50 Message-ID: References: <87poz5ytcf.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 20 Nov 2015 22:41:29 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="13783"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7OoYR57fV3sNX2piTZJ0CLAQg69LNwpc=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:PuXe4fklAXX+DjNlyMZh9hmmMAg= Xref: csiph.com comp.lang.java.programmer:33167 On Fri, 20 Nov 2015 21:52:01 +0000, Martin Gregorie wrote: > On Fri, 20 Nov 2015 17:27:38 +0000, Stefan Ram wrote: > >> Cecil Westerhof writes: >>>What is the ?best? way to use this? I normally only use it when >>>necessary. (A function has a parameter with the same name.) But at the >>>company I am working there are people who say you should use it always. >> >> If the people are your boss (lead programmer or some such), you >> should use it always. >> > That depends whether your boss is a bozo. Example: on one project where > I was technical lead, the Programming Manager issued a fairly sensible > coding spec (including the use of meaningful variable and function > names, > e.g. maxvalue for a limiting int value and search_namelist() for a > function that searched for a match and returned a pointer to the > matching namestring or NULL, and then went off on holiday for two weeks. > Meanwhile we got stuck in and wrote/unit tested the system's > infrastructure code, naturally adhering to the coding spec. > > Project Manager can back and immediately issued a new coding spec he'd > evidently written while on holiday. This mandated - bloody Hungarian > Notation. This standard would have required that int to be called > iMaxvalue and the search function to be called psNamelist and, apart s/psNamelist/psSearchNamelist/ > from making code less readable, means that what should be trivial > changes like replacing an int with a long or a double with a float, > would require all references to those variable to be hunted down and > their names changed. > > The bozo had heard that coding specs can never be changed once code s/had heard/had not heard/ > exists. His reaction, once we'd pointed out how much code would need > changing and retesting, was to effectively drive a truck through any and > all coding standards by saying that existing code didn't need to be > changed but all code written after then had to use Hungarian notation. > > May $codingDeity protect you from ever having to work for such an idiot. Apologies for the typos. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |