"Clean code always looks like it was written by someone who cares."— Robert C. Martin (Uncle Bob)
public class Document
{
public void Show()
{
// Visible Code
}
public void Hide()
{
// !Visible Code
}
}
int timeoutInMs = 1000;
int usedMemoryInKb = 42;
int brushSizeInPx = 20;
var stopwatch = Stopwatch.StartNew();
public void Method(Data data)
{
// Use data.Value
}
public List<int> GetList()
{
if (!isAvailable)
{
return new List<int>();
}
}
public class XOptions
{
// Properties
}
XService(IOptions<XOptions> options)
{
XOptions _options = options.Value;
}
public void Test()
{
// Arrange
// Act
// Assert
}
enum Enum
{
Member
}
var enumString = nameof(Enum.Member);
try
{
// Code that might throw
}
catch (Exception ex)
{
log.Error(ex);
throw;
}
if (condition)
{
// Code
}