Re: Re: Improving PHP's type system

From: Date: Sat, 16 Apr 2016 09:04:45 +0000
Subject: Re: Re: Improving PHP's type system
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-92363@lists.php.net to get a copy of this message
"Marco Pivetta" wrote in message news:CADyq6sJfPYgQvhQt=UvCBqkooJjoUPCz1sUfzwXc+55hL0PpzA@mail.gmail.com...
Tony, that sounds really like "real programmers use dd -if -of". Please stop with that argument, as it really doesn't reflect reality.
That is not what I said. As a follower of the KISS principle I believe that good programmers write simple code that anyone can understand, while less-than-good programmers write complex code that only a select few can understand. The problem with adding all these new and shiny features to the language is that it makes the language more complicated, especially when it comes to all those edge cases which keep arising. Changes like this are making the language more complicated by getting it to do in core what used to be done in userland code. All that is happening is that it becomes more complicated to update the language for genuine improvements which would be appreciated by the masses instead of these over-complications which are only for the benefit of the few who think programming should be restricted to those who have Phd's.
I keep enhancing my software with new (stricter) type checking, when available. For example, I'm eager to replace current docblocks declaring void methods with the upcoming hint (7.1), and every time I add hints and type strictness I find new hidden bugs on an already well-tested code (with 100% coverage and mutation testing). These bugs are legit, they are just waiting to happen.
That just proves that your unit testing did not in fact have 100% coverage. If a potential bug hasn't been encountered by a real user then it doesn't actually cause a problem, and if it doesn't cause a problem then why does it need a solution? Even Microsoft, the largest software company in the world, does not attempt to fix every possible bug only those bugs which cause problems.
Additionally, I would also love to get rid of docblocks for type-systems: they are unreliable, hard to reflect and enforce nothing, which allows lazy and sloppy programmers to just circumvent specifications as it best pleases their mood, rather than the requirements. Yes, I'm a real programmer too, and no, I don't use cosmic rays to write code to my computer's hard drive, give it a rest. On Apr 15, 2016 08:09, "Tony Marston" <TonyMarston@hotmail.com> wrote:
"Levi Morrison" wrote in message news:CAFMT4Nr4GmnBBsOfydF5sLOtaEo1rZZiPdGdV8v6y+Z-6PVCOg@mail.gmail.com...
There are too many people out there who are trying to make the language
more complicated than it need be just to prove how clever they are.
I can assure you I am not proposing these RFCs to show how clever I am.
If millions of programmers have written millions of lines of code to write effective programs WITHOUT the use of type hinting/enforcement, then how come there are some people out there who keep saying that PHP is a bad language because it does not have type checking? Those who cannot write effective software without these "clever" additions to the language are doing nothing but announcing to the world that they are not clever enough to write effective software using their own limited abilities. -- Tony Marston -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
-- Tony Marston

« previous php.internals (#92363) next »