A colleague and I was just wondering, why was TypInfo.pas not named TypeInfo.pas? The original theory of 8.3 naming convention doesn't hold as TypInfo is 7 characters long. A typo detected too late?

Comments

  1. Could be because of a (bad) parser issue, thinking that it if it was TypeInfo, that the parser would pick up 'Type' as a keyword, and not the unit name...?

    ReplyDelete
  2. may be the original authors were not native English speakers. :)

    ReplyDelete
  3. Nicholas Ring That would hold if the unit was called Type.pas.

    TypeInfo is used as a parameter name quite often in procedures inside the unit, but I doubt that that would cause a parser issue.

    ReplyDelete
  4. Ugochukwu Mmaduekwe LOL, could be! But I would have expected QA/Other devs to pick up on that.

    ReplyDelete
  5. Willo van der Merwe​ I would guess that unit has been around since Turbo Pascal days, so the parser may not be as good as it is now...

    ReplyDelete
  6. Willo van der Merwe Yes, I think I've read it somewhere that the original Delphi devs liked to say "TypInfo" with German pronunciation.

    ReplyDelete
  7. I really don't know the story behind this. My take has been that given TypeInfo is a global functions (and possibly a special one) you don't want to have a conflict with that name, even if the parser would be fully capable of handling it...

    ReplyDelete
  8. Because of collision: though hardly documented in the early Delphi days the standard function TypeInfo has been there forever so http://docwiki.embarcadero.com/Libraries/en/System.TypeInfo already takes TypeInfo in the global namespace as the System unit is used by default and doesn't have a namespace prefix (see http://docwiki.embarcadero.com/VCL/XE/en/System.TypeInfo and http://docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4/EN/html/devwin32/cwgregisteringthepropertyeditor_xml.html)

    One more reason to suffix unit names with a word like Unit.
    docwiki.embarcadero.com - System.TypeInfo - RAD Studio API Documentation

    ReplyDelete

Post a Comment