Clean Code is an Art

int c = 0; \\counter value
DateTime dt;
int counter = 0; 
DateTime systemGeneratedDate;
class Customer
{
}
is better thanclass CustomerDetails
{
}
public DateTime GetPlannedScheduledDate()
{
return plannedScheduledDate;
}
is better than the below function here:public DateTime GetDate()
{
return plannedScheduledDate;
}
//Bad comments example//Comment:Checking if an account is currently active
if(!account.IsDeleted && account.AvailableBalance > 500 && account.lastTransactionDate > DateTime.Now.AddMonths(-3))
{
//code logic
}
if(account.checkIfAccountActive())
{
//code logic
}
private bool checkIfAccountActive()
{
return !account.IsDeleted && account.AvailableBalance > 500 && account.lastTransactionDate > DateTime.Now.AddMonths(-3);
}
//This is our best attempt to get a race condition by creating large number of threads. 
for (int counter = 0; counter < 2500; counter ++)
{
//Code which creates a thread with every loop here.
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store