I was just curious. How many, and if some or anyone uses the pimpl idiom when writing in your own personal project or not.
Mods delete this if you think this is a stupid poll
I was just curious. How many, and if some or anyone uses the pimpl idiom when writing in your own personal project or not.
Mods delete this if you think this is a stupid poll
Well, if the "personal project" happens to be a library project where it makes sense to use PIMPL due to binary compatibility requirements, then of course.
J-P Nurmi
Well I mean, like for person project where it's not like a library but an application itself.
Yes, even in personal projects. Mostly for things that I plan to make reusable (that is, the things that could eventually end up in a library )
While you were hanging yourself on someone else's words
Dying to believe in what you heard
I was staring straight into the shining sun
Yes, I'm using it all along my code. In libraries ( for binary compatibility ).
And also in any program I've to made, to avoid "stupid recompilations" ( oops, I've added a private member to "that" base class & ALL the app gets recompilated... )
I think in general It's a good practice to put the less you can / need in header files and use pimpl.
I'm often using it in my projects in three cases:
1. I want good code separation
2. I'm implementing a library or a class that I think might become part of a library in future
3. I'm creating implicitly/explcitly shared data classes (where you have to use P-IMPL)
P-IMPL makes your code harder to read so it should be avoided where maintenance is a priority or where weaker programmers are involved.
Bookmarks