1
vote
4answers
187 views

Is there a good way to communicate the intent that a class only contains referentially transparent methods?

My workplace mostly uses C# for writing code. I'm trying to figure out a good way to indicate that a class with referentially transparent methods is intended to be referentially transparent (i.e., ...
13
votes
4answers
962 views

Which way to terminate reading loop is the preferred approach?

When you have to iterate a reader where the number of items to read is unknown, and the only way to do is it to keep reading until you hit the end. This is often the place you need an endless loop. ...
3
votes
2answers
333 views

Extracting lambda expressions from linq queries and readability

Every now and then when I have a complex lambda, I do something like this: Func<SomeObject, bool> equals = o => o.ID == someID && o.Name == someName && IsAdd || ... var ...
6
votes
3answers
512 views

Is 'using' appropriate in a context where there is nothing to dispose?

In C#, using statement is used to dispose in a deterministic manner the resources without waiting for garbage collector. For example, it may be used to: Dispose SQL commands or connections, Close ...
-1
votes
1answer
197 views

Checking timeouts made more readable

I have several situations where I need to control timeouts in a technical application. Either in a loop or as a simple check. Of course – handling this is really easy, but none of these is looking ...
10
votes
6answers
3k views

Is C# becoming harder to read?

As C# has progressed, many language features have been added. It has come to the point where it's becoming unreadable for me. As an example, consider the following code snip from Caliburn.Micro code ...
18
votes
7answers
7k views

How far should 'var' and null coalescing operator '??' be entertained without hampering readability?

I know the title of the question is very subjective, but I was confronted with usage of ?? operator by my peers, where at the same time I was not very happy/comfortable with applying var in new ...
5
votes
4answers
2k views

Is nesting types considered bad practice?

As noted by the title, is nesting types (e.g. enumerated types or structures in a class) considered bad practice or not? When you run Code Analysis in Visual Studio it returns the following message ...