I do. I have some experience and I've come to the conclusion procedural, simple code is more readable. Simple code is less prone to errors. There are certain elements to functional programming that are useful. Like preferring pure functions. But in general it's biggest sin is that its hard to be productive and is full of performance traps.
However, above is bad for a multitude of reasons.
If you are unfamiliar with the functions used you have to jump around the code to find out what is happening. That is context switching and bad for debugging. This happens a lot more in this functional style because of the emphasis on lambdas and small composable functions. Instead of reading the code I have to figure out how the programmer intended to put these composable functions together. Bad!
If there is a bug in one of the chained operations you have to untangle the whole thing to figure out which part. This is time consuming and bad for debugging and I also do not see how it is less prone to errors. More operations are happening than you can reasonably think about here, and if you don't think that then you aren't the only one who is going to read your code.
Bad for compile times as someone else suggested
It shows intent but I don't care about the programmers intent. I care about what the programmer has written. This feels like obfuscation and hand wavy attempts for the person writing it to convince me it does what it says it does. I can't know that just from looking at this line of code, and I will have unpick it to understand. That's not productive.
I also forgot to mention operator overloading which is absolute hell when you are trying to look at the performance of some code.
2
u/[deleted] Dec 16 '21
Do you have experience with functional languages? That might be the dividing line between people that consider this more or less readable.
It absolutely is less error-prone. There are so many subtle bugs you can introduce in this code.
For profiling, the profile will be slightly differently structured (because of the view wrapper type), but it should have the same elements.