<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx" -->

---
title: Clean Code in TypeScript | daily.dev
description: Code smells or bad code doesn&#x27;t mean that the code is not usable, but as a programmer, I think we should produce reusable, readable, and refactorable software....
canonical: https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Clean Code in TypeScript | daily.dev
og:description: Code smells or bad code doesn&#x27;t mean that the code is not usable, but as a programmer, I think we should produce reusable, readable, and refactorable software....
og:url: https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx
og:image: https://api.daily.dev/og/posts/xvdHkKJJx.png
og:image:alt: Clean Code in TypeScript
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 in TypeScript

**[Medium](https://daily.dev/sources/medium_js)** · 3 min read · 208 upvotes · 4 comments

## Summary

Code smells or bad code doesn't mean that the code is not usable, but as a programmer, I think we should produce reusable, readable, and refactorable software. I will not repeat the mistakes in the last article, if you haven’t read it, please check it out.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://javascript.plainenglish.io/clean-code-in-typescript-a183d43f3bf0?source=rss------javascript-5>

## Community discussion

Top comments from developers on daily.dev.

**@cgarrison** · 1 upvotes

> Well, two things within this "Clean Code in TypeScript" would be considered against the recommended practices.
>
> 1. [types-vs-interfaces](https://www.typescriptlang.org/play#example/types-vs-interfaces) found on typescriptlang
>
> ```
> // That said, we recommend you use interfaces over type
> // aliases. Specifically, because you will get better error
> // messages. If you hover over the following errors, you can
> // see how TypeScript can provide terser and more focused
> // messages when working with interfaces like Chicken.
> ```
>
> 2. [Single Assertion] depends on what you are testing
>  and with what...

**@ajaydhangar49** · 1 upvotes

> nice

**@ghost** · 0 upvotes

> Teeny-tiny things to take care of 💯

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript)

[View this post on daily.dev](https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx)

```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 in TypeScript","url":"https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx"},"datePublished":"2022-11-15T05:52:47.320Z","dateModified":"2022-11-15T05:52:47.174Z","description":"Code smells or bad code doesn't mean that the code is not usable, but as a programmer, I think we should produce reusable, readable, and refactorable software....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c255436649d79cc9fbae35e25e5b64d9","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c255436649d79cc9fbae35e25e5b64d9","isAccessibleForFree":true,"articleSection":"Medium","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":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":4,"discussionUrl":"https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":208},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":4}],"keywords":"typescript","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Clean Code in TypeScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/clean-code-in-typescript-xvdhkkjjx","comment":[{"@type":"Comment","text":"Well, two things within this “Clean Code in TypeScript” would be considered against the recommended practices.\n\ntypes-vs-interfaces found on typescriptlang\n\n// That said, we recommend you use interfaces over type\n// aliases. Specifically, because you will get better error\n// messages. If you hover over the following errors, you can\n// see how TypeScript can provide terser and more focused\n// messages when working with interfaces like Chicken.\n\n\n[Single Assertion] depends on what you are testing\nand with what tool (https://docs.cypress.io/guides/references/best-practices#Creating-tiny-tests-with-a-single-assertion)","datePublished":"2022-11-15T14:16:31.292Z","dateModified":"2022-11-15T14:16:50.888Z","url":"https://daily.dev/posts/xvdHkKJJx#c-B9YYlCiJz","author":{"@type":"Person","name":"Christian Garrison","url":"https://daily.dev/cgarrison","image":"https://lh3.googleusercontent.com/a-/AOh14GhiZSfASoFLFhiHP66k0cQwGreKA67E3mMNP3-A=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"nice","datePublished":"2022-12-21T20:35:31.865Z","url":"https://daily.dev/posts/xvdHkKJJx#c-gKdo6ZThg","author":{"@type":"Person","name":"Ajay Dhangar","url":"https://daily.dev/ajaydhangar49","image":"https://lh3.googleusercontent.com/a/AEdFTp52X5ua8AxWeNfDimlEwhoq1hugDfaOPrE7aEb9hQ=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Teeny-tiny things to take care of 💯","datePublished":"2022-11-16T07:28:57.710Z","url":"https://daily.dev/posts/xvdHkKJJx#c-bdVyMJcvs","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"}}]}
```

