---
title: "Comment by Peter Sumskas on \"Refactoring transaction blocks with the endless method\" | Hashnode"
description: "It’s an interesting exploration. I’m not quite in favour of it. I reckon that in a busy codebase the = transaction do will be easy to miss, while the extra bloc"
url: "https://hashnode.com/posts/refactoring-transaction-blocks-with-the-endless-method/6673d0e5f3a9e4bdb601ba3b/comment/6676385e6c9716cfa7c72469"
---

[Discussion](https://hashnode.com/posts/refactoring-transaction-blocks-with-the-endless-method/6673d0e5f3a9e4bdb601ba3b)

Comment [Refactoring transaction blocks with the endless method](https://hashnode.com/posts/refactoring-transaction-blocks-with-the-endless-method/6673d0e5f3a9e4bdb601ba3b)

[Peter Sumskas](https://hashnode.com/@PeterSumskas)

[Jun 22, 2024](https://hashnode.com/posts/refactoring-transaction-blocks-with-the-endless-method/6673d0e5f3a9e4bdb601ba3b/comment/6676385e6c9716cfa7c72469)

It’s an interesting exploration. I’m not quite in favour of it. I reckon that in a busy codebase the `= transaction do` will be easy to miss, while the extra block is clearer.

I don’t think the goal should be “less lines” rather it should be “more clarity”.

If I wanted to “wrap” things in transactions then I might lean towards meta-programming 😱 and have a class method that takes a symbol of the method name and wrap that in a transaction by renaming the method. E.g `transaction def update_fnargle …`

But I’d think long and hard if that is enough of a gain in clarity before I lean on either technique.

[Lucian Ghinda](https://hashnode.com/@lucianghinda)

[Jul 9, 2024](https://hashnode.com/posts/refactoring-transaction-blocks-with-the-endless-method/6673d0e5f3a9e4bdb601ba3b/comment/6676385e6c9716cfa7c72469#reply-668d22a35224655481ed1ddd)

I agree that this is not the type of code that one can find usually. This is why I wanted to explore some refactoring with it and see how it looks/feels like.

I also agree with you that I will not go to meta-programming as an alternative very easy even if maybe it will promote the `transaction` keyword in front and more visible
