Re: PHP global namespace clogged up
From: Tony Marston (tony_at_NOSPAM.demon.co.uk)
Date: 09/06/04
- Next message: Tony Marston: "Re: PHP global namespace clogged up"
- Previous message: Tony Marston: "Re: PHP global namespace clogged up"
- In reply to: Tim Tyler: "Re: PHP global namespace clogged up"
- Next in thread: Tim Tyler: "Re: PHP global namespace clogged up"
- Reply: Tim Tyler: "Re: PHP global namespace clogged up"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 6 Sep 2004 10:36:08 +0100
"Tim Tyler" <seemysig@cyberspace.org> wrote in message
news:2q2imbFqcghuU1@uni-berlin.de...
> Terence wrote:
>> Tim Tyler wrote:
>
>>> I think:
>>>
>>> $a = "98.6";
>>> $b = $a->floor();
>>>
>>> ...should fail with an "unknown method" error - and would suggest using:
>>>
>>> $a = "98.6";
>>> $b = $a->number()->floor();
>>
>> or perhaps
>>
>> $a = "98.6";
>> $b = real::parse($a); // $b is a real
>> $b = (int)$b->floor(); // now $b is an int
>
> If you want an integer - rather than a number - that doesn't look
> unreasonable - but it seems further modified from the original code.
>
>> this still requires some flexibility of typing but it's hard to know
>> where to draw the line.
>>
>> either way, you will now *REQUIRE* ALL PHP programmers to use an OO
>> notation. Unless they understand even the most basic principles of OO,
>> the syntax will look confusing. I personally didn't bother to check out
>> the OO side of PHP for many months after I first started learning it. It
>> was a few years before I took advantage of it in any serious way.
>> Requiring people to understand OO concepts straight of the bat is not
>> going to help it's ease of adoption for people who aren't already
>> programmers before they get into the language. Remember, PHP's shining
>> success is based on it's easy accessibility. While your suggested
>> notation may strenghten one of PHP's weaknesses, I believe introducing a
>> compulsory OO notation will undermine it's fundamental strength of easy
>> adoption.
>
> $a -> method() is really not any harder than method($a) to learn.
>
> I can see an issue if you have to learn two ways of doing things
> (rather than one) - but that would not be needed.
>
> Beginners would be helped by by not having two learning curves
> to climb - one for the procedural syntax and one for the OO syntax.
So what you are saying is that PHP should drop its library of procedural
functions and replace it with a pure OO alternative? That would break
backwards compatability with all existing scripts so would be unacceptable
to the greater PHP community.
Dream on, moron.
-- Tony Marston http://www.tonymarston.net > There are also things such as getting a drop-down auto-complete > list of functions when they type $a -> in their IDE - in the > case where the type of the variable can be determined analytically before > runtime. > -- > __________ > |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply. >
- Next message: Tony Marston: "Re: PHP global namespace clogged up"
- Previous message: Tony Marston: "Re: PHP global namespace clogged up"
- In reply to: Tim Tyler: "Re: PHP global namespace clogged up"
- Next in thread: Tim Tyler: "Re: PHP global namespace clogged up"
- Reply: Tim Tyler: "Re: PHP global namespace clogged up"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|