---
title: "Mortal sin: Just \"Doit\""
url: "https://osherove.com/blog/2004/2/19/mortal-sin-just-quotdoitquot.md"
canonical: "https://osherove.com/blog/2004/2/19/mortal-sin-just-quotdoitquot.html"
published: "2004-02-19T14:05:00"
updated: "2004-02-19T14:05:00"
tags: [".Net Original"]
author: "Roy Osherove"
description: "You've been there before, right? a big ass method (200-600 lines ) with a mess of SQL, logic and “SELECT * from...” in it. And it's called... “ Doit ”. Yep. I swear. But then it got worse. A method just as big, looks…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Mortal sin: Just "Doit"

By Roy Osherove February 19, 2004 In [.Net Original](https://osherove.com/blog/category/net-original)

**Historical article** · Originally published February 19, 2004; technical details may be outdated.

You've been there before, right? a big ass method (200-600 lines ) with a mess of SQL, logic and “SELECT \* from...” in it. And it's called... “**Doit**”. Yep. I swear.

But then it got worse.

A method just as big, looks practically the same, named... aha. “**Doit1**”. I kid you not.

Can you guess the problems arising from such code, kids?

Can you guess how many serial killers got started the day they had to maintain such code?

Solution: **Don't Doit**.

- Give a **good name** to your method that describes what it's trying to do.
- Make sure it only does one task and calls other methods to do other stuff.
- Learn what [Refactoring](https://www.amazon.com/exec/obidos/ASIN/0201485672/iserializable-20) means.

## More in .Net Original

[All posts in .Net Original](https://osherove.com/blog/category/net-original)

- Feb 22, 2004

    ### [\[Book\] Writing Secure Code, 2nd Edition](https://osherove.com/blog/2004/2/22/book-writing-secure-code-2nd-edition.html)

- Feb 21, 2004

    ### [Iterating over collections - As simple as possible, but no simpler.](https://osherove.com/blog/2004/2/21/iterating-over-collections-as-simple-as-possible-but-no-simp.html)

- Feb 19, 2004

    ### [Mortal sin: A non-relational relational database.](https://osherove.com/blog/2004/2/19/mortal-sin-a-non-relational-relational-database.html)

- Feb 19, 2004

    ### [Get your resource kit (and disregard the kit name)](https://osherove.com/blog/2004/2/19/get-your-resource-kit-and-disregard-the-kit-name.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
