Results 1 to 17 of 17

Thread: My own Hungarian notation style

Hybrid View

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

    Default Re: My own Hungarian notation style

    Quote Originally Posted by fatjuicymole View Post
    The developer would still know what types that are trying to use, so it would still work.
    So... I need to have the whole inheritance tree in my head just to find out what the variable holding my FooBar is called? I still prefer to call my FooBar object foobar or m_foobar, regardless if it is an unsigned int or a QStyleOptionViewItemV4.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: My own Hungarian notation style

    I suppose I'd be remiss not to mention another, very simple build system that's readily available - qmake. I've been using it for a few simple, non-Qt projects lately, and it's hard to beat it for simplicity and speed of assembling a build system.

    Not sure how well it scales to large, heterogenous projects, but it ain't bad for small to medium size tasks.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My own Hungarian notation style

    Quote Originally Posted by wysota View Post
    So... I need to have the whole inheritance tree in my head just to find out what the variable holding my FooBar is called? I still prefer to call my FooBar object foobar or m_foobar, regardless if it is an unsigned int or a QStyleOptionViewItemV4.
    You misunderstand. You could type foobar and be offered the suggestion "m_szFoobar", the developer would know that he actually does want a null terminated string, so would select that option.

    I've also fixed the quoting in my previous post that may clear up the confusion.

  4. #4
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: My own Hungarian notation style

    I personally find that Hungarian notation just makes the code look like crap (Look at KVIrc's source code). And with modern IDE's (one's that aren't crap). can tell you a variable's type by hovering over it. Why you think Qt doesn't use all those crappy variable names? If you use it with an api that doesn't. Just makes it more confusing.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My own Hungarian notation style

    There will always be arguments for and against. For example, why force someone to hover over a variable to find out it's type when a quick glance will tell you the type without moving your mouse?

  6. #6
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: My own Hungarian notation style

    I'd rather hover over the thing than having a glance at a variable called m_nFoo and concluding that it's a signed integer while some asswipe forgot to change the name to m_szFoo...
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My own Hungarian notation style

    That kind of thing would be picked up at the software review stage and the appropriate engineer fired for being incompetent.

  8. #8
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: My own Hungarian notation style

    *should be picked up.

    Not abiding by hungarian notation is something I wouldn't consider being incompetent, but we all have our opinions
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Replies: 3
    Last Post: 17th April 2010, 21:35
  2. QwtPlot axis decmials/notation
    By dfirestone in forum Qwt
    Replies: 1
    Last Post: 1st May 2009, 10:42
  3. qdoublespinbox with scientific notation
    By pospiech in forum Qt Programming
    Replies: 13
    Last Post: 3rd January 2009, 14:50
  4. Hungarian Notation vs others
    By sunil.thaha in forum General Programming
    Replies: 11
    Last Post: 27th September 2007, 06:49
  5. Replies: 1
    Last Post: 7th February 2007, 00:12

Tags for this Thread

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.