0

I'm going into my sophomore year of college and I do a-lot of programming on my free time to a point where I have already finished many topics that I'm set to learn in class, my professor already had all of his assignments up for the 260 class I'm taking as I finished two of them I realized that he will only be teaching the rule of three but I have been using the rule of five, I'm curious should I be continuing the rule of five and do dev's use one over the other. Or are there times to use one over the other.

Thanks!

  • 1
    rule-of-zero, rule-of-three, rule-of-five... all those rules of thumb can be appropriate. In the right circumstances. – Deduplicator Aug 09 '20 at 02:43
  • 1
    According to Wikipedia, the rule of 5 is an extension of the rule of three that added two more items which hadn't previously been implemented in C++. It sounds to me like the two rules are not mutually exclusive, they were just coined at different times in the development of the language. https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming) – Keara Aug 09 '20 at 02:47
  • 2
    @Keara in the c++ tag this means something different: https://en.cppreference.com/w/cpp/language/rule_of_three – Matt Timmermans Aug 09 '20 at 03:09
  • 2
    @MattTimmermans that is what I was referencing, yes - but it's very probable that even still my comment doesn't make much sense! I hadn't heard about the rules before - I just thought I would mention what I found with a quick search, but it's very possible that what I read was incorrect or misleading. – Keara Aug 09 '20 at 03:11
  • @Keara ah, yes, I followed your incorrect link instead of reading your perfectly correct text :) – Matt Timmermans Aug 09 '20 at 04:22
  • 1
    @MattTimmermans Oops! Yeah, that link is wrong isn't it... there's the right one (I hope!) https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming) – Keara Aug 09 '20 at 04:25

0 Answers0