[TYPO3-core] $GLOBALS vs globals

Kasper Skårhøj kasper2006 at typo3.com
Thu Oct 26 22:50:42 CEST 2006


I agree with Ingmar, see my other posts.

Lets "change" the old code by writing so much new and better code  
that some day the old code is obsolete and can be removed since not  
needed anymore...

- kasper


On Oct 26, 2006, at 13:29 , Ingmar Schlecht wrote:

> +-0.
>
> My opinion:
> 	- don't change existing code
>
> 	- for new code, $GLOBALS should be the suggested
>           but not enforced way.
>
> cheers
> Ingmar
>
>
> Ernesto Baschny [cron IT] schrieb:
>> Martin Kutschker schrieb am 26.10.2006 11:45:
>>
>>> I use global whenever I use them same variable more than once or
>>> twice. Eg spelling $GLOBALS['TSFE'] ten times is tiresome and not
>>> even easy to read.
>>
>> In my view it is exactly the opposite: It enhances the readability of
>> the code, because you can know exactly what variable you are acessing
>> here and it will be much easier later to identify dependencies on
>> certain globals.
>>
>> Writing them could be a matter of copy&paste or some other helper
>> methods. I think we should not spare characters just to be able to  
>> type
>> them faster, the code should be readable and understandable.
>>
>>> I do not favour a codig style that forbids "global" altogether.
>>
>> I would favor such a style.
>>
>>> Maybe in TYPO3 5.0 we can use singletons and do not use globals at
>>> all, but please don to not force us to use $GLOBALS['TSFE'],
>>> $GLOBALS['TCA'] every single time.
>>
>> TYPO3 5.0 is a different story, $GLOBALS should only be used at a
>> minimum, but I think we should aim for that "minor" change in 4.1.  
>> What
>> do others think?
>>
>> Cheers,
>> Ernesto
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-core

- kasper

"Necessity is the mother of invention"
-------------------------------
kasper2006 at typo3.com | +45 20 999 115 | skype: kasperskaarhoej |  
gizmo: kasper_typo3








More information about the TYPO3-team-core mailing list