Results 1 to 12 of 12

Thread: Hungarian Notation vs others

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Hungarian Notation vs others

    Quote Originally Posted by elcuco View Post
    ...and even Qt uses it to some sort: on_actionOpenFile_triggered() for example.
    I disagree. It's something completely different. It's just a way to have an easily parsable string containing both the object and the method. I'd say it more resembles the "descriptive" approach.

    And still I don't fully agree with a statement that a hungarian-like naming convention enables one to easily find variables of a given type. It's fine as long as you are the only one reading the code, but I doubt anyone who doesn't know Qt would guess that qsfpmSomething stands for QSortFilterProxyModel and without knowing what qsfpm means the convention is useless and error prone. However I accept it as a fully qualified variable naming convention. As they say - "Whatever makes you happy...".

  2. #2
    Join Date
    Jan 2006
    Posts
    371
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    14
    Thanked 18 Times in 17 Posts

    Default Re: Hungarian Notation vs others

    Quote Originally Posted by wysota View Post
    I disagree. It's something completely different. It's just a way to have an easily parsable string containing both the object and the method. I'd say it more resembles the "descriptive" approach.

    And still I don't fully agree with a statement that a hungarian-like naming convention enables one to easily find variables of a given type. It's fine as long as you are the only one reading the code, but I doubt anyone who doesn't know Qt would guess that qsfpmSomething stands for QSortFilterProxyModel and without knowing what qsfpm means the convention is useless and error prone. However I accept it as a fully qualified variable naming convention. As they say - "Whatever makes you happy...".
    on_actionOpenFile_triggered()

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Hungarian Notation vs others

    You mean the "action" part? It's strictly coincidential. Could be "on_OpenTheFuBEEEPWindow_clicked()" as well... As far as I understand HN, it is based around abreviations and we don't have such things here. Even the object is called "actionOpenFile" and not "aOpenFile". According to me that makes a huge difference.

  4. #4
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    76
    Thanked 37 Times in 32 Posts

    Default Re: Hungarian Notation vs others

    And I believe that HN, will fails when templates come to picture.

    How will a QMap< QString, QMap<QString, QList<MyCustomClass> > > be called ...
    We can't solve problems by using the same kind of thinking we used when we created them

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.