Skip to main content
Theraot's user avatar
Theraot's user avatar
Theraot's user avatar
Theraot
  • Member for 12 years, 11 months
  • Last seen more than a month ago
awarded
awarded
awarded
awarded
awarded
revised
Loading…
awarded
revised
Loading…
revised
Loading…
awarded
awarded
revised
Loading…
comment
Getting buy-in for cleaner and more structured code
@reggaeguitar Perhaps example work better than my word soup. async/await allows you to worry about what the code does without worrying about concurrency. Linq allows to separate where you get your data, from when to stop, from what you do with it. Without it you will have nested loops, that interleave those concerns. RAII allows you to separate deallocation. And you could work around a language that does not support such things, but that would require to introduce other code to make it work. Often some patterns, which require new classes. Plus the discipline to use them.
comment
Getting buy-in for cleaner and more structured code
@reggaeguitar We often think of separation of concerns at a smaller scale. It happens inside a method, for example. It is in the way you write them. It does not have to mean extracting routines or classes. However, it can be useful to extract methods and classes for separation of concerns. In particular generators are a very useful tool for that. Also you may introduce new classes to make invariants concrete, or to reuse. Is that discovering or creating responsibilities? I'm not sure how to tell. We can certainly invent responsibilities. At the end of the day, these are guidelines.
comment
Getting buy-in for cleaner and more structured code
@reggaeguitar For a piece of code, everything you need to consider is a concern. A single routine will have multiple concerns. And a concern can affect multiple routines. Separating them means that you should write the code in a way that you can consider one without worrying about the others. However, by single responsibility principle, a module should take care of a single responsibility. I'm taking responsibility to mean reason for change, and external to the system. And yes, that would mean that responsibilities are concerns too.
revised
Loading…
Loading…
comment
C# convention for empty constructor
@Flater I don't want to wait for tests to run to discover I should not have removed this code block. And put me on the bad developers, because I began doing this for myself. I guess I should be writing more comments then.
1
2 3 4 5
34