Re: Coding standard proposal

From: Date: Mon, 21 Apr 2008 12:47:57 +0000
Subject: Re: Coding standard proposal
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49837@lists.php.net to get a copy of this message
On Mon, Apr 21, 2008 at 2:03 AM, Adam Harvey <aharvey@php.net> wrote: > Quoting David JEAN LOUIS <izimobil@gmail.com>: > > > But this should by no means become a standard - people (like me) who > > don't like very much hungarian notation should also be free to *not* > > use it. > > > > +1. I maintain that if you don't know what type a variable you're dealing > with is, you have bigger problems than a notation standard, and that's just > as true of loosely typed languages as it is of strictly typed ones. > > Some would say our coding standards are too strict already -- let's not > add another reason for developers to get annoyed when developing PEAR code. > If the PEAR Coding Standards were to be augmented with a requirement to use Hungarian Notation we would see an immense drop in contributions; one reason for this is the combination of the lengthening of variable names that adopting Hungarian Notation would incur with the 75-85 max line lenght that is codified in the PEAR Coding Standards would cause [potentially] well written code to be split over perhaps several lines and risk becoming less easily understood because of that split. Also what happens in regards to established APIs? Hungarian notation seems to be a way of avoiding writing proper documentation that APIs should not be without and code written internal to APIs should be well written and maintainable without a necessity of encoding the variable type into each and every variable name and also, as you imply, names of functions and methods. This as, Michael mentioned, would introduce inconsistencies into API declarations at best and at worse introduce bugs. It may also see a widening chasm of inaccuracy between documentation and 'live code'. A cluttering of well written code with variable types embedded into names of variables is not the most intelligent thing to do. k.

« previous php.pear.dev (#49837) next »