1 / 10

Modern C++ in practice

Modern C++ in practice. Goals. Practical experience of C++ best practices, idioms and details Design patterns in C++ Generic, functional and template programming Using boost and STL Utilize APIs, books and mailing lists Coherent coding style and get to know each other.

Download Presentation

Modern C++ in practice

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modern C++ in practice

  2. Goals Practical experience of • C++ best practices, idioms and details • Design patterns in C++ • Generic, functional and template programming • Using boost and STL • Utilize APIs, books and mailing lists Coherent coding style and get to know each other

  3. Why bother with details? Cons • More than 20 years old • Backwards compatible with C • Lots of mistakes in both language and library • Very complex Pros • Powerful features • Well spread • Vivid community • Rapidly developing

  4. Polymorphism in C++ • Virtual keyword • Function pointers • Function overloading • Implicit type conversion • Concepts • Policy classes • Argument dependent lookup (ADL) • Partial template specialization

  5. C++ programming • Object oriented programming • Generic programming • Functional programming • Template metaprogramming Blend these paradigms to acheive code that is • Simple and easily read • Decoupled and testable • Robust to change • Reusable

  6. Roadmap Very unclear Start today and see how it evolves Think about: • What you want to learn? • Should we add or remove goals?

  7. Today • boost::variant • boost::signals • Discuss slots n’ signals relation to bind and function • My observable class • Pair-wise design of a toy problem • Discuss design differences

  8. Toy problem: Cat n’ Rat Design logical interfaces and concepts for a simple game 2D discrete coordinate world Contains cats, rats, cheese and obstacles Move events appear for cats and rats Collision detection, not handling

  9. Toy problem: Focus Focus the design on • Low coupling, high cohesion • Robustness to future changes • Event driven information flow When working try to • Use boost and STL • Push error checking towards compile and link time • Write generic code when it doesn’t complicate design

  10. Future suggestions Implement logical model Design and maybe implement: • Text view • Collision handling • Serialization • Simple client/server • Extend game functionality Implement message distributor

More Related