19 things I stole from great developers

What great developers do day to day

Daniel Anderson
Sep 27 · 6 min read
What great developers do day to day
What great developers do day to day
Photo by Thirteen .J on Unsplash

Rule of 3.

It states that you are allowed to copy and paste the code once, but that when the same code is replicated three times, it should be extracted into a new procedure.

Consistency is king

Reduce nesting

A guard clause is simply a check that immediately exits the function, either with a return statement or an exception.

if (account != null)
{
if (order != null)
{
if (order.term == Term.Annually)
{
// term annually
}
else if (order.term == Term.Monthly)
{
// term monthly
}
else
{
throw new InvalidEnumArgumentException(nameof(term));
}
}
else
{
throw new ArgumentNullException(nameof(subscription));
}
}
if (account == null)
{
throw new ArgumentNullException(nameof(account));
}
if (order == null)
{
throw new ArgumentNullException(nameof(order));
}
if (order.term == Term.Annually)
{
// term annually (return here)
}
if (order.term == Term.Monthly)
{
// term monthly (return here)
}
throw new InvalidEnumArgumentException(nameof(order.term));

Think of the bigger picture

Spend time thinking of naming things

Technical debt is bad

Technical debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy (limited) solution now instead of using a better approach that would take longer

Overestimate

Documentation and code comments

Be confident about deleting bad code

Spend time on code Reviews

Write good tests

Spend time designing

Focus on the fundamentals and not on the syntax

Make Google your best friend

Make sure it works first, then make it pretty later

Risk management and problem resolution

Ask questions

Keep logic out of the database whenever possible

Create, read (aka retrieve), update, and delete

KISS

Keep It simple Stupid

return dir.Keys.Any(k => k >= limit) ? dir.First(x => x.Key >= limit).Value : dir[dir.Keys.Max()];

Conclusion

JavaScript In Plain English

New JavaScript + Web Development articles every day.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

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