<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/refactoring-old-code-arjkzpemg" -->

---
title: Refactoring old code | daily.dev
description: A colleague asked me to write an extension on an old codebase. The old code was using loops and wasn&#x27;t really efficient with the tools we have nowadays. I...
canonical: https://daily.dev/posts/refactoring-old-code-arjkzpemg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Refactoring old code | daily.dev
og:description: A colleague asked me to write an extension on an old codebase. The old code was using loops and wasn&#x27;t really efficient with the tools we have nowadays. I...
og:url: https://daily.dev/posts/refactoring-old-code-arjkzpemg
og:image: https://api.daily.dev/og/posts/ArjkZpEmG.png
og:image:alt: Refactoring old code
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.

# Refactoring old code

**[Hashnode](https://daily.dev/sources/hashnode)** · [@dailydevtips](https://daily.dev/dailydevtips) · 4 min read · 57 upvotes · 7 comments

## Summary

A colleague asked me to write an extension on an old codebase. The old code was using loops and wasn't really efficient with the tools we have nowadays. I decided to use the Map method to map the data into the desired format. The last thing we need is to have the array sorted based on the number variable.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://h.daily-dev-tips.com/refactoring-old-code>

## Community discussion

Top comments from developers on daily.dev.

**@way2extreme** · 3 upvotes

> The comments on this article are hilarious. It would seem that most people disagree with the author.

**@bscott** · 2 upvotes

> Good read

## 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: [#angular](https://daily.dev/tags/angular), [#general-programming](https://daily.dev/tags/general-programming), [#html](https://daily.dev/tags/html), [#react](https://daily.dev/tags/react), [#vuejs](https://daily.dev/tags/vuejs)

[View this post on daily.dev](https://daily.dev/posts/refactoring-old-code-arjkzpemg)

```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":"Refactoring old code","url":"https://daily.dev/posts/refactoring-old-code-arjkzpemg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/refactoring-old-code-arjkzpemg"},"datePublished":"2021-01-14T12:09:49.426Z","dateModified":"2026-03-15T03:53:13.109Z","description":"A colleague asked me to write an extension on an old codebase. The old code was using loops and wasn't really efficient with the tools we have nowadays. I...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/acb3d23c890fd2eb5fba136739f8b4e0","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/acb3d23c890fd2eb5fba136739f8b4e0","isAccessibleForFree":true,"articleSection":"Hashnode","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":"Person","name":"Chris Bongers","url":"https://daily.dev/dailydevtips","image":"https://media.daily.dev/image/upload/s--9gxFz1e7--/f_auto/v1705902590/avatars/avatar_JUNiIGCV-?_a=BAMAMiZW0","description":"Daily blogger and web team lead at daily.dev 💖","worksFor":{"@type":"Organization","name":"daily.dev","logo":"https://daily-now-res.cloudinary.com/image/upload/s--MASZOhnv--/f_auto/v1614088267/landing/Daily.dev_logo"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":51595}},"commentCount":7,"discussionUrl":"https://daily.dev/posts/refactoring-old-code-arjkzpemg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":57},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"keywords":"angular,general-programming,html,react,vuejs","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hashnode","item":"https://daily.dev/sources/hashnode"},{"@type":"ListItem","position":3,"name":"Refactoring old code"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/refactoring-old-code-arjkzpemg","comment":[{"@type":"Comment","text":"The comments on this article are hilarious. It would seem that most people disagree with the author.","datePublished":"2021-01-19T13:47:53.267Z","url":"https://daily.dev/posts/ArjkZpEmG#c-pZRmyrZ8Q","author":{"@type":"Person","name":"Rod Hartzell","url":"https://daily.dev/way2extreme","image":"https://avatars3.githubusercontent.com/u/862497?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"Good read","datePublished":"2021-01-15T06:18:59.430Z","url":"https://daily.dev/posts/ArjkZpEmG#c-p5in_BHtI","author":{"@type":"Person","name":"Brian Scott","url":"https://daily.dev/bscott","image":"https://avatars1.githubusercontent.com/u/191290?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
```

