---
title: "Comment by andrei on \"Refactoring old code\" | Hashnode"
description: "Man, good job on writing and puttin you out there, but I made an account just to reply on this. Hate to see things overused just because they&#39;re shiny. I no"
url: "https://hashnode.com/posts/refactoring-old-code/5fffe819c162d710c9b14a49/comment/60005b74c162d710c9b154ae"
---

[Discussion](https://hashnode.com/posts/refactoring-old-code/5fffe819c162d710c9b14a49)

Comment [Refactoring old code](https://hashnode.com/posts/refactoring-old-code/5fffe819c162d710c9b14a49)

[andrei](https://hashnode.com/@kernel)

[Jan 14, 2021](https://hashnode.com/posts/refactoring-old-code/5fffe819c162d710c9b14a49/comment/60005b74c162d710c9b154ae)

Man, good job on writing and puttin you out there, but I made an account just to reply on this. Hate to see things overused just because they're shiny.

`I noted there was some legacy code that was using loops and wasn't really efficient with the tools we have nowadays`.

You replaced one completely fine loop with two loops and a ton of allocations. `for` is not freaking outdated. I think you meant to say "pretty" or "easier to follow", because the "modern" version is way, way less efficient than the original.

[Chris Bongers](https://hashnode.com/@dailydevtips)

[Jan 14, 2021](https://hashnode.com/posts/refactoring-old-code/5fffe819c162d710c9b14a49/comment/60005b74c162d710c9b154ae#reply-60007c03b00f7510ee95aa75)

Hey Kernel

I might have actually better called the article "Modernizing your code" since the refactor wasn't a hard need, the code is working as is, and nothing wrong with it.

This would just be the modern-day approach.
