[TYPO3-core] RFC #8985: Enable USER object to become USER_INT on the fly

Ingo Renner ingo at typo3.org
Thu Jul 17 10:33:24 CEST 2008


Dmitry Dulepov [typo3] wrote:

>> 11: name the variable $doConvertToUserInt or $convertToUserInt - 
>> always use lowerCamlCase for variables
> 
> Object is called USER_INT, not UserInt. The name chosen to make a quick 
> understanding of code. It does not follow camelcase but the name makes 
> more sense than camelcase in this particular case. Readability of the 
> code is more important than formality.

exactly, UserInt is more readable and conforms to the CGL, USER_INT doesn't

>> 27, 34: add a public access designator. What does OT mean? No 
>> abbreviations, please.
> 
> OT = object type. CGL does not disallow abbreviations. If we add more 
> constants we may prefer to separate them from each other in some way. 
> Prefix is a standard way to do it.

I proposed that multiple times already, also FLOW3/TYPO3 5 has it, and 
what's most important is that it makes life easier for those who don't 
know the insights - even I didn't know what you mean (although I could 
guess, but guessing is not what we want)

>> 72: the comment is not quite clear, needs to be indented with a tab
> 
> Not according to CGL.

Then we have to add it. I think it was mentioned during T3DD, but I 
might have forgotten to write it down. Also, just check most other 
comments... same style.

>> 75: couldn't that call be moved into the else branch? Seems to be the 
>> only place where $tempContent is used...
> 
> Probably it could.

It could or it is? If it isn't right now I really suggest to move it 
into the else branch as it then would save an unnecessary call if only 
the if branch is met.

>> 106: name the method convertToUserInt()
> 
> To "user integer"? ;) There is no such thing as UserInt in TYPO3.

The CGL requires lower camel case for methods, there's no arguing. You 
might also call it convertToUserIntObject if you like, let's just have 
speaking names that do not require to read the doc comment to understand 
what the method does.



Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2


More information about the TYPO3-team-core mailing list