5 ms·
Multiple leaps of faith. "More constraints mean more easier to understand" is a little too reductive. Replace streams with "operator". All your program code ca
by rdsubhas 5y ago
Multiple leaps of faith. "More constraints mean more easier to understand" is a little too reductive.
Replace streams with "operator". All your program code can be written as operators like dot or plus, and since those operators gave constraints, then the whole program will be simpler, right?
If that were true, we'll still be writing code in assembly, managing registers by hand. Because hey, just 256 registers means that you can reuse your knowledge of registers everywhere, which means programs will be easier to understand again, right?
There are examples in threads which show real examples where plain code is better.
- galaxyLogic 5y agoAll streams work very similarly. Much more similarly than if you mix and match all kinds of operators together. Think Unix pipes they are easy to understand because they all behave similarly. Yes sometimes plain code is better sure but in cases where streams fit the job they are better. I guess the main point is that streams operate on multiple elements and they operate the same on every element. Therefore you don't need to reason what happens to every element that goes through the pipe. It is a bit like adding and multiplying matrices, you can understand the calculation without having to mentally follow how each matrix element is processed.