Results 1 to 17 of 17

Thread: My own Hungarian notation style

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Lightbulb My own Hungarian notation style

    I'm planning on quite a huge project that handles lots of details (don't they all), and would like to teach myself a clear, good style for coding. I understand this is partially personal, but if I'm doing something utterly forbidden by <fill in the blank> or downright stupid, I'd like to know beforehand
    Some questions:
    1) I'm adapting hungarian notation, but hate the "standard", so here it is:
    - (u)int: (u)i_...
    - float: f_...
    - double: d_...
    - string: s_...
    - size_t: sz_...
    - (u)intptr_t: (u)ptr_...
    - vector<string>: v_s_...
    - vector<class T *>: vptr_...
    - Constructor and simple set-function arguments meant to be put in the initializer list are not prefixed (data members are clear enough): say a class has an int and a float as data member, then the Class would look like this (I know, implementation in header is bad...):
    Qt Code:
    1. class MyClass
    2. {
    3. public:
    4. MyClass(const float myFloat, const int myInt)
    5. : myFloat(f),
    6. myInt(i)
    7. { };
    8. private:
    9. float f_myFloat;
    10. int i_myInt;
    11. };
    To copy to clipboard, switch view to plain text mode 
    That last bit just to avoid stupid mandatory renaming of the arguments.

    2) The project is a build system for c/c++ and eventually other stuff as well. I read online that CMake has some (optional?) dependencies and that that sucks for a "build system", especially or using it on a tight-kept Linux install. But this means that stuff like directory listing and file access will have to be handled by me, in contrast to Qt's great functions/classes for exactly that. Thoughts?

    3) Going on from point 2, for example getting directory listing (to resolve a search for all *.cpp files), there are two ways (except Qt of course):
    - system(dir) and system(ls) platform specific and output parsing
    - platform specific messes with native OS function calls.
    The first is simpler in principle, but probably slower and harder to get right. The second will require lots of research by me.

    Any comments are welcome, I appreciate all help/input/contribution.
    Last edited by rubenvb; 16th May 2010 at 17:02. Reason: constructor example is wrong code

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.