[TYPO3-dev] Extensions need update for 4.3!

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Oct 13 18:25:30 CEST 2008


Ingo Renner wrote: on 13.10.2008 17:14:

>>> Ernesto Baschny [cron IT] wrote:
>>>> Well, NULL wasn't wrong until probably 4.3, those extensions were not
>>>> "broken" before, which is why I don't think they should "brake" after
>>>> the 4.3 upgrade.

>>> I think it depends on the view. Does saying "array" mean that null is
>>> right? To me it looks wrong.

>> Yes, good notice. It looks wrong to you, but nobody ever stated it was
>> wrong. We could change it now so it is wrong, but I see no apparent
>> reason to do so.

> I say it was never right, why should we declare it as right now?!

That is somehow a philosophical question, in which we probably won't
come to an agreement.

I am not stating at all that I like or endorse those "lazy coders" or
"badly coded extensions". I am on your side and of your opinion that
developers that pass uninitialized variables to a function expecting an
array should shame themselves, or even rot in hell. But this is not the
issue here, but backwards compabitility: caring for users that are using
our beloved TYPO3 application, which might for some misfortune be
running one (or several) of those rotten extensions. I care a lot for
those people, and I think more core developers also do.

>> Even java, which is known for its strong enforcement of types works like
>> that:
>>
>> class HintApp {
>>     public static void main(String[] args) {
>>       HintApp.test1(null);
>>       HintApp.test2(null);
>>     }
>>     public static void test1(String[] args) {
>>       System.out.println("Hello 1");
>>     }
>>     public static void test2(HintApp test) {
>>       System.out.println("Hello 2");
>>     }
>> }
> 
> but this is something really different: it's function/method
> overloading... nothing to do with this issue here (type hinting).
> 
>> Works like a charm. I passed "null" to a method expecting an array of
>> string and to another method expecting a class.
> 
> no, you past null to a different function, with the same name.

The methods are called test1 and test2 on purpose. That is not the same
name. So please re-read, keeping that in mind.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list