|
Posted by Treefrog on 03/30/06 14:04
David Haynes wrote:
> Well, you could do it in PHP5 by wrapping all the basic types in classes
> like java does for a lot of things. Then each type class would have its
> own toXXX converters to handle the casts.
Cute. I might spend some time playing with that idea. but I'd prefer if
PHP had built in support...
> This is an example of 'fixed with another level of abstraction' and I
> wonder at the utility of it all. PHP - like shell - is often attractive
> to coders *because* it is loosely typed.
>
> I'm not sure how many coders would find PHP as attractive if they had to
> follow stricter object type coding.
Hmm, I agree I think, hence wanting the option to use strict types. The
problem is, from my experience, people initially use PHP because it's
easy and they can get their idea realised in a short time with a
minimal leanring curve/expense. Unfortunately, soem of these ideas
actually work and start making money, sometimes BIG money, and they are
left with poorley coded legacy crap that everybody firefights to keep
working... and any improvments are complete kluges.
I'm not sure what can be done to change that, but I want to stay with
PHP, it can be used for huge scalable systems, but only if coded
properly. I suppose I'm clutching at straws to make it harder to write
bad code.
Navigation:
[Reply to this message]
|