Does my variable naming convention have a name?

前端 未结 5 658
猫巷女王i
猫巷女王i 2020-12-17 21:57

So I go by this Delphi naming scheme of arguments start with A, class vars start with F and local vars start with M. Does that scheme have a name? I see it a lot in the Del

5条回答
  •  不知归路
    2020-12-17 22:21

    I would say your naming convention doesn't really match the Hungarian Notation, but it tends a bit to be closer to the original Hungarian Notation invented by Charles Simonyi which came to be known as Apps Hungarian. But not quite.

    There are actually two types of Hungarian Notation:

    • Apps Hungarian - the idea was to decorate identifiers names based upon the semantic information of what they store, so basically the variable's purpose:
        rwElement - variable represents a row ("rw")
        colElement - variable represents a columns ("col")
    
    • Systems Hungarian - the prefix encodes the actual datatype of the variable.
        szName - variable is a zero-terminated string ("sz")
        lAccount - variable is a long integer ("l")
    

    So while you naming convention does in a way represent some sort of purpose, it's not really the purpose that Apps Hungarian refers to.

提交回复
热议问题