On 4 March 2015 00:46:49 GMT, Yasuo Ohgaki <yohg...@ohgaki.net> wrote: >Hi Rowan, > >On Wed, Mar 4, 2015 at 7:12 AM, Rowan Collins <rowan.coll...@gmail.com> >wrote: > >> You are measuring the wrong cost. The cost of adding new names is to >> people writing code: >> >> - additional confusion for new users about why everything has two >names >> and which they should use >> - extra effort for new developers to learn the new names, even if >they >> only read them in other people's code (it slows me down every time I >see >> sizeof() and have to remember it's just an alias of count()) >> - awkward decision for project leaders: use the old names for >familiarity >> and compatibility with older versions, or the new ones because >they're >> arguably better names >> - if an existing project does choose the new names, the overhead of >> converting all the existing code, with the risk of bugs introduced by >> incorrect automation, noise in commit logs, merge conflicts, etc >> - if a project needs to run on PHP 5, the vigilance required to avoid >> accidentally using the new names when developing on PHP 7 >> >> That's not an exhaustive list, and some of these aren't huge costs, >but >> collectively they outweigh the benefit of a slightly more consistent >set of >> names for things. >> >> This is why a more radical change - an OO-style API for scalars and >basic >> modules, a fundamentally new set of functions which fulfil a specific >need, >> etc - has the potential for acceptance, and this proposal does not. >The >> costs are mostly fixed, so we need to increase the benefits to >outweigh >> them. >> > >This is fair discussions. We should care these also. I agree these >costs >exist >and shouldn't ignored. > >I have different point of views. It's long term view or new user point >of >view. >For me, it outweighs costs you've mentioned.
Several of the costs I listed are for new users, and several will continue indefinitely if we don't remove the old names, and are therefore long term. Could you be more explicit in the benefits you see? I.e. day to day, how will users lives be better with these new names? >- PHP has API inconsistency even for most basic APIs like phpversion(), >htmlspecialchars(), etc > - Even bundled modules have non standard function names. > - API parameter ordering is inconsistent. > - Return type for errors are inconsistent. e.g. Wrong number of param >returns NULL, while others return FALSE mostly. For me, argument order and return inconsistency is a much worse problem than name inconsistency. Unfortunately, it's also harder to fix without massive BC breaks. Again, this leads to the conclusion of replacing the entire legacy API, rather than trying to patch over it. I also think having two names for every function will count as a negative to the kind of people who write these matrixes, and the fact that it was done to fix a previous negative won't change that. Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php