2 ms·
This seems like a trivial example though. read_csv(options: Options) All you've shown is that Options has a lot of configurability, but you'd have the sam
by hombre_fatal 2y ago
This seems like a trivial example though.
read_csv(options: Options)
All you've shown is that Options has a lot of configurability, but you'd have the same problem if you posted the whole class with all of its fluent API methods; it would be even more characters.
Also, you can use built-in control flow logic to modify options before passing them into the function rather than depend on a developer to implement a fluent API for every class.
But this isn't an example of FP vs OOP. Just replace `read_csv(options)` with `constructor(options)`.