Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give up "function-centric" design #7

Open
programaker opened this issue Dec 10, 2021 · 0 comments
Open

Give up "function-centric" design #7

programaker opened this issue Dec 10, 2021 · 0 comments
Labels
refactoring Improve things without change behavior

Comments

@programaker
Copy link
Owner

Scala is not as good as Haskell or F# to work with stand-alone functions.

  • It is not as easy to compose them; ends up with lots of h(g(f(x))) which have a bad usability (reads and writes from right to left). Scala 2's type inference doesn't help much with point-free style either. Method chaining works better.
  • The design of the application looks different from Scala itself and the libs.
  • It's not very editor friendly; VSCode for instance doesn't index top-level definitions.
  • Lack of namespacing where the functions are called looks strange.
  • Functions-as-services are very granular; this has its advantages but in the end it's more work and the editors/ides won't help you finding the concrete functions of that type like they do with traits. Program dependencies, type aliases, R environment all become enormous because of this granularity.
  • It's different from everything in the community. You never see any devstar designing applications or libraries like this in Scala, not even the most FP fanatics. One of the core principles of Scala design is being Object-functional, so let it be, as long as the "Object" part is restricted to traits for services, ADTs for data (allowing them to have smart constructors and combinators) and objects as namespaces for the pure programs.
@programaker programaker added the refactoring Improve things without change behavior label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Improve things without change behavior
Projects
None yet
Development

No branches or pull requests

1 participant