Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a section on best practices #78

Closed
theanalyst opened this issue Dec 15, 2021 · 7 comments
Closed

Introduce a section on best practices #78

theanalyst opened this issue Dec 15, 2021 · 7 comments
Assignees
Labels
Essentials Content for the "essentials" course
Milestone

Comments

@theanalyst
Copy link
Contributor

Since this is a fairly generic idea, for starts we could introduce a simple slide linking to Core Guidelines (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). Maybe we could cherry-pick a few guidelines that are commonly considered good, for eg:

  • Interfaces -I.3 (singletons) as well as I.11 & I.13 (avoid raw_ptr ownership transfer, avoid passing arrays without length)
  • Errors - E.6 use RAII
  • Classes - C.131 Avoid trivial getters/setters

(Fairly opinionated list ;)

@hageboeck
Copy link
Contributor

hageboeck commented Jan 19, 2022

Some more ideas:

  • If you have a debate about how to do something, check core guidelines
  • When to use free functions (anonymous namespace) and when member functions
  • Keep headers clean, low number of includes?

And on the repetition side:

  • Use smart pointers
  • Pass by reference

@theanalyst
Copy link
Contributor Author

Some more ideas:

* [ ]  If you have a debate about how to do something, check core guidelines

Definitely. I feel like for new comers this should give some pointers on doing things in mostly correct way

* [ ]  When to use free functions (anonymous namespace) and when member functions

* [ ]  Keep headers clean, low number of includes?

👍

And on the repetition side:

* [ ]  Use smart pointers
* [ ]  Pass by reference

Yeah this would be nice, esp. understanding ownership, ie. naked pointers as a view only resource

@krasznaa
Copy link
Contributor

As we discussed just now in our meeting, here are the ATLAS coding standards. Which could be pointed to, together with those of the other experiments. 😉

http://atlas-computing.web.cern.ch/atlas-computing/projects/qa/draft_guidelines-0.2.html

@chavid chavid added the Essentials Content for the "essentials" course label Feb 23, 2022
@chavid chavid added this to the March22 milestone Feb 23, 2022
@stale
Copy link

stale bot commented Jul 19, 2022

This issue or pull request has been automatically marked as stale because it has not had recent activity. Please manually close it, if it is no longer relevant, or ask for help or support to help getting it unstuck. Let me bring this to the attention of @klieret @wdconinc @michmx for now.

@stale stale bot added the stale label Jul 19, 2022
@hageboeck hageboeck modified the milestones: March22, Oct22 Aug 17, 2022
@hageboeck
Copy link
Contributor

Decided to make a box/design for making good practices easily recognisable, and put the good practices right next to the places where the rationales can be explained.

@hageboeck hageboeck mentioned this issue Sep 6, 2022
@hageboeck hageboeck removed the stale label Sep 20, 2022
@bernhardmgruber bernhardmgruber modified the milestones: Oct22, March23 Feb 15, 2023
@bernhardmgruber
Copy link
Contributor

I think we should discuss the SOLID principles at the end of the OOP chapter to give some guidance: https://en.wikipedia.org/wiki/SOLID

@hageboeck
Copy link
Contributor

Closing in favour of #507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Essentials Content for the "essentials" course
Projects
None yet
Development

No branches or pull requests

5 participants