We currently have 3 developers with some, conflicting styles, and I'm looking for a way to bring peace to the kingdom ...
Encoders:
Foo 1 : I like to use Func and Action inside public methods. It uses actions to alias long method calls and Func to perform simple tasks that can be expressed in 1 or 2 lines and will be used often through code
Pros: The bulk of its code is concise and very readable, often with one or two public methods for each class and rarely any private methods.
Cons:. The beginning of the methods contains blocks with lambda code that other developers do not like to read; and, sometimes, it may contain higher-order functions that other dev REALLY dislike reading.
Foo 2: I like creating a private method of (almost) everything a public method should do.
Pros . Public methods remain small and readable (for all developers).
Against . There are many private methods. With private methods that call other private methods that call ... etc. Etc. It is very difficult to move the code.
Foo 3: You like to create a public class with one, public method for each non-trivial task that needs to be performed and then injected into other objects.
Advantages : easily verifiable, understandable (one object, one responsibility).
Cons : the project becomes inundated with classes, opening several class files to understand what the code does, makes navigation inconvenient.
It would be great to use all of these methods ...
Foo-1 Has really nice, readable (almost dsl-like) code ... for the most part, with the exception of all the Action and Func lambda synonyms combined together at the beginning of the method.
Foo-3 Has a highly verifiable and extensible code that just perceives a little “belt and loopholes” for some solutions and has some code-navigation errors (constantly hitting F12 in VS and opening 5 other .cs files to find what one method does) .
And Foo-2 ... Well, I'm not sure I like something about one huge .cs file with 2 public methods and 12 private ones, except for juniors it is easier to dig.
I admit that I have oversimplified the explanations of these coding styles; but if anyone knows any patterns, practices, or diplomatic maneuvers that can help bring our three developers together (just without telling any of them just “stop it!”), that would be great.
In terms of feasibility:
- The Foo-1 style meets the most resistance due to the fact that some developers find lambda and / or Func difficult to read.
- The Foo-2 style meets with less resistance, as it just flows so easily.
- Style Foo-3 requires the most advanced thinking and it is difficult to ensure when the time is short.
Any ideas on some coding styles or conventions that might make this work?