<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2" -->

---
title: Clean code tips - names and functions | daily.dev
description: Drawing on chapters 2 and 3 of Robert Martin's Clean Code, this piece shares practical tips for writing readable C# code: using consistent naming across the...
canonical: https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Clean code tips - names and functions | daily.dev
og:description: Drawing on chapters 2 and 3 of Robert Martin's Clean Code, this piece shares practical tips for writing readable C# code: using consistent naming across the...
og:url: https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2
og:image: https://api.daily.dev/og/posts/bYypAyRf2.png
og:image:alt: Clean code tips - names and functions
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Clean code tips - names and functions

**[Code4IT](https://daily.dev/sources/code4it)** · 9 min read · 0 upvotes · 0 comments

## Summary

Drawing on chapters 2 and 3 of Robert Martin's Clean Code, this piece shares practical tips for writing readable C# code: using consistent naming across the codebase, keeping functions small and single-purpose, maintaining consistent abstraction levels, preferring polymorphism over switch statements, avoiding side effects that mutate input parameters, minimizing function arguments, and preferring exceptions over error codes. Each tip is illustrated with before-and-after C# code examples, including a refactor of a function that filters, reverses, and stringifies numbers, and a Ticket pricing example refactored from a switch statement into subclasses.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.code4it.dev/blog/clean-code-names-and-functions>

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Clean code tips - names and functions","url":"https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2"},"datePublished":"2026-10-04T13:07:18.245Z","dateModified":"2026-10-04T13:15:44.553Z","description":"Drawing on chapters 2 and 3 of Robert Martin's Clean Code, this piece shares practical tips for writing readable C# code: using consistent naming across the...","image":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","thumbnailUrl":"https://media.daily.dev/image/upload/s--1KxV4ohY--/f_auto/v1722860400/public/Placeholder%2007","isAccessibleForFree":true,"articleSection":"Code4IT","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Code4IT","logo":"https://media.daily.dev/image/upload/s--OaaG4G10--/f_auto,q_auto/v1791119049/logos/code4it?_a=BAMAMicg0","url":"https://daily.dev/sources/code4it"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/clean-code-tips---names-and-functions-byypayrf2","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,c#","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code4IT","item":"https://daily.dev/sources/code4it"},{"@type":"ListItem","position":3,"name":"Clean code tips - names and functions"}]}
```

