Re: [PHP6] Function name consistency

From: Date: Thu, 02 Jan 2014 20:00:29 +0000
Subject: Re: [PHP6] Function name consistency
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-70968@lists.php.net to get a copy of this message
>On Thu, Jan 2, 2014 at 8:42 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > HI all, > > On Fri, Jan 3, 2014 at 2:49 AM, Robert Parker <rparker@yamiko.org> wrote: > >> I would consider myself one of those php developers. I know very little c, >> and java. Javascript is my second language after php. Most php developers >> have yet to move towards 5.3 and don't know how to even use namespaces or >> what they are. They often use wordpress or drupal which are very slow to >> adapt. >> >> Considering how slow and hard it is for most php developers to migrate to >> new versions of php I do not think creating aliases or changing the names >> would be beneficial. Different developers would use different aliases and >> it would confuse a lot of php developers. >> > > This proposal does not intend to force users to adopt new names, but ensure > PHP popularity in the long run. > > Are new users willing to learn language that have full of inconsistent > names > even for basic/standard/default functions? > > My intention to have consistent function names for old function is > > - to ensure PHP as attractive language to learn even 10 or 20 years later. > > I agree that adoption of new feature is slow. If we made function names > consistent now, there would be codes around uses historic names 10 years > later, but it does not matter for the purpose of this proposal. > > De facto Standard names such as strchr() would be acceptable names even > 20 years from now. Other functions such as GD functions are better to have > consistent names. > > Please consider this proposal is for new users that will learn PHP from now > or > in the future. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net If you look at golang you'll see they have 'go fix' http://golang.org/cmd/fix/ which helps mitigate the effects of language changes automatically. I suppose it wouldn't be a problem with having a tool that can generate an AST out of a .php file and dump it back to a newer syntax (as long as only the function / method / classes name and parameter order is changing). The issue I see is that people are stuck into the: 'bbbut it's using the underlying uber-duper library and if a dozen people know about it then it must be a good thing' approach. Also, having a flag in the engine, with some ini_set(blah, true) seems like a poor decision imo. Fix the problem at the source, don't clutter the engine because the php users are too lazy to run an automated tool. And yes, I do suggest that PHP should start to impose a certain formatting, since it would be needed by this tool, but if you look past the initial: ':(((( I want my tabs / spaces back' or whatever, in a couple of days / weeks everyone would forget about the formatting issues and just focus on the code. @Yasuo, if you really want to keep PHP attractive maybe you should look on what golang is doing because imo they served every other languages a lesson in tooling and not only. ---- Florin Patan / @dlsniper https://github.com/dlsniper http://www.linkedin.com/in/florinpatan

« previous php.internals (#70968) next »