---
title: "Create More Readable Code By Interface Prefixes"
url: "https://osherove.com/blog/2003/5/28/create-more-readable-code-by-interface-prefixes.md"
canonical: "https://osherove.com/blog/2003/5/28/create-more-readable-code-by-interface-prefixes.html"
published: "2003-05-28T08:17:00"
updated: "2003-05-28T08:17:00"
tags: [".Net Original"]
author: "Roy Osherove"
description: "Here's something that might help write more readable code: When defining a class that implements an interface, instead of just declaring the interface overrides like so: public class MyCustomHandler :…"
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/"
---

# Create More Readable Code By Interface Prefixes

By Roy Osherove May 28, 2003 In [.Net Original](https://osherove.com/blog/category/net-original)

**Historical article** · Originally published May 28, 2003; technical details may be outdated.

Here's something that might help write more readable code:

When defining a class that implements an interface, instead of just declaring the interface overrides like so:

      public class MyCustomHandler:IConfigurationSectionHandler

      {          

            public object Create(object parent, object configContext, System.Xml.XmlNode section)

            {return null;}

      }

you can explicitly prefix the name of the method with the name of the interface and a dot, and removing "public" modifiers from the signature, thus making it look like this:

      public class MyCustomHandler:IConfigurationSectionHandler

      {          

            object IConfigurationSectionHandler.Create(object parent, object configContext, System.Xml.XmlNode section)

            {

                  return null;

            }

      }

This makes for a more readable and explicit code, and states exactly which methods belong to what interface. It also saves writing comments for when their really needed. Could be a great way to show coding examples that do not use #region fields (not to mention that some coders don't use VS.NET, and their IDE does not recognize #region fields - this makes the code \*tons\* more readable)

another thing about this:

If I write object IConfigurationSectionHandler. in this class I'll automatically get a drop-down of the methods of IConfigurationSectionHandler. This **works in VS.Net 2002(!).** unfortunatly, it does not stuf out the methods parameters as well, but it's a nice tidbit to know... 

## More in .Net Original

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

- May 30, 2003

    ### [Improving Typed Datasets](https://osherove.com/blog/2003/5/30/improving-typed-datasets.html)

- May 28, 2003

    ### [Performance Tuning and Optimizing ASP.NET Application](https://osherove.com/blog/2003/5/28/performance-tuning-and-optimizing-aspnet-application.html)

- May 28, 2003

    ### [.Net Developer Journal May Issue PDF download](https://osherove.com/blog/2003/5/28/net-developer-journal-may-issue-pdf-download.html)

- May 28, 2003

    ### [About Dynamic Plug-in Discovery And AppDomains](https://osherove.com/blog/2003/5/28/about-dynamic-plug-in-discovery-and-appdomains.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/
