Re: OOP leads to lousy websites?
Chung Leong wrote:[color=blue]
> Type conversion can't take place in the case of null->Length() since
> it's unclear what to convert to.[/color]
What you wrote here has absolutely no point. As NULL is not an object, it
can't have a method. And if you have an object, it cannot be NULL. So yout
moint is moot.
[color=blue]
> Strlen() has no problem since it
> knows what it's expecting. Even when a conversion is impossible (e.g.
> array_push(fals e, true)), a function can simply do nothing. The
> problem with OOP in PHP is that it essentially introduce type back
> into the language.[/color]
No -- it introduces classes, and classes *are* types by definition. If you
have a problem with that, fine -- don't use objects, use arrays and
functions.
Berislav
--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Chung Leong wrote:[color=blue]
> Type conversion can't take place in the case of null->Length() since
> it's unclear what to convert to.[/color]
What you wrote here has absolutely no point. As NULL is not an object, it
can't have a method. And if you have an object, it cannot be NULL. So yout
moint is moot.
[color=blue]
> Strlen() has no problem since it
> knows what it's expecting. Even when a conversion is impossible (e.g.
> array_push(fals e, true)), a function can simply do nothing. The
> problem with OOP in PHP is that it essentially introduce type back
> into the language.[/color]
No -- it introduces classes, and classes *are* types by definition. If you
have a problem with that, fine -- don't use objects, use arrays and
functions.
Berislav
--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Comment