Results 1 to 8 of 8

Thread: Clean way to keep all private variables in class ( private struct, pimpl idiom )

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Clean way to keep all private variables in class ( private struct, pimpl idiom )

    Coding rules are important, and that's important to keep these rules during all the development.
    For class member, keep the "m_" or just "m" front of variables.
    Use "Set", "Get", "Count" and "Compute" in function's names.

  2. The following user says thank you to Alundra for this useful post:

    Kryzon (4th March 2015)

  3. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Clean way to keep all private variables in class ( private struct, pimpl idiom )

    pimpl is only really needed if you need platform-independent data or wanting to hide a lib data.
    Or you want to shorten the rebuild time (change in the class internals will require to rebuild only the class.cpp file). Very useful in large projects IMHO.

Similar Threads

  1. Replies: 4
    Last Post: 5th April 2012, 12:38
  2. Segfault while using Pimpl idiom with Qt types.
    By darkadept in forum Qt Programming
    Replies: 11
    Last Post: 13th June 2009, 00:53
  3. Do you use Pimpl Idiom?
    By ComaWhite in forum General Discussion
    Replies: 5
    Last Post: 25th March 2009, 09:48
  4. Omitting private part of a class definition
    By Raistlin in forum General Programming
    Replies: 2
    Last Post: 23rd March 2007, 11:51
  5. Replies: 2
    Last Post: 4th May 2006, 19:17

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.