r/cpp • • 25d ago

How I design C++ classes

https://rafb.eu/blog/cpp-class-design/

This is my first ever blog-post, any feedback is welcome! ofc, no AI got used.

66 Upvotes

46 comments sorted by

View all comments

2

u/Sachu_James 25d ago

The part about not jumping between header and cpp when you add a method stuck with me. I have felt that pain with heavy template headers, where one include drags compile time up for everything that touches it. The factory version keeping the impl in one cpp file while the header stays clean feels like the main win here, more than the testability bit.