Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33166

Re: Using this

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Using this
Date 2015-11-20 21:52 +0000
Organization A noiseless patient Spider
Message-ID <n2o4m1$tim$1@dont-email.me> (permalink)
References <87poz5ytcf.fsf@Equus.decebal.nl> <this-20151120182555@ram.dialup.fu-berlin.de>

Show all headers | View raw


On Fri, 20 Nov 2015 17:27:38 +0000, Stefan Ram wrote:

> Cecil Westerhof <Cecil@decebal.nl> 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 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 
exists. His reaction, once we;d pointed out how much code would need 
changing an 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 gad to use Hungarian notation.

May $codingDeity protect you from ever having to work for such an idiot.
 

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using this Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:21 +0100
  Re: Using this Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-20 08:15 -0500
  Re: Using this Eric Douglas <e.d.programmer@gmail.com> - 2015-11-20 05:43 -0800
  Re: Using this Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-20 21:52 +0000
    Re: Using this Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-20 22:41 +0000
  Re: Using this Arne Vajhøj <arne@vajhoej.dk> - 2015-11-20 20:26 -0500
  Re: Using this Brixomatic <brixomatic@yahoo.com> - 2015-11-29 16:25 +0100
  Re: Using this Lew <lewbloch@gmail.com> - 2015-11-29 22:51 -0800

csiph-web