Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thanks for the guidance, a partial class would be much more suitable in this case. My main goal is just to organise the code by separating and grouping methods so this works perfectly. Commented Oct 28, 2018 at 0:00
  • 1
    a partial class isnt a great way to seperate code. ok you now have 2 files, but you still just have one class doing everything Commented Oct 28, 2018 at 15:13
  • 1
    methods should be verbs, action words. Monkey is not a verb. What action is taken when I call Monkey? I fully agree with your suggestion. However, in OP's defense, the method was meant to be used after .Add. (which is either a class name or factory method name). I don't quite agree with OP's idea of using the Add class/factory method, but I do see why he then would avoid a redundant second "add" in the subsequent method name. Commented Oct 29, 2018 at 8:17
  • @Ewan: Partial classes can be used in a bad way but that doesn't mean partial classes are bad or shouldn't be used. Yes, partial classes can be used to split a monolith class into multiple pieces, without actually solving the issue of having a monolith class. However, it's important to remember that having a monolith class is the actual issue; having a partial class is not an issue in and of itself - it is simply "unethically" used to hide the monolith from sight. Commented Oct 29, 2018 at 13:10
  • 1
    @flater I didnt say any of that, but you are right, I do think partial classes are always bad. When a question about them comes up, remind me and I will put a long answer detailing why I am totally right and you are totally wrong and we can have a dance off to decide what the correct answer going forward will be Commented Oct 29, 2018 at 18:02