

But this can lead to over engineering simple stuff. Which makes the code harder to read and maintain and more error prone. Especially if you don’t need all the other stuff for the class. Worse, if you define a class then you also tend to add more stuff you don’t use, just in case it might be useful.
A simple variable name is sometimes the better solution. But it depends on the situation off course. Sometimes a new class make things more clear, as it abstracts some complexity away. Yeah, we need to find a balance and that is different for every program.
^(update: just added a new link)^
The way you describe and show it, is called foldmethod “marker”. The advantage of markers are, that they are built into the file. The disadvantage is, its built into the file. I rather like having the source independent from folding markers. The good news is, you can change the foldingmethod in Neovim and ignore the marker comments and instead use your own method.
A simple one is just “manual”, where you set what is foldable and not. There are some automatic ones, like based on indentation and such. I was never a folding guy anyway, so don’t really know all the differences when to use and how they differ. Neovim has following foldmethod: manual, indent, expr, syntax, diff, marker. The “expr” method even allows you a custom code and logic.