New answers tagged

1 vote

How to organize a chain of functions that share parameters, functional programming

Objects can be used in a pure functional way. In a language like Scala with good object support, often the cleanest way is to just use an object. You can also take advantage of scoping inside ...
user avatar
4 votes

How to organize a chain of functions that share parameters, functional programming

One alternative is, in case these "ambient" parameters are some sort of context, is to use Monads. It really depends on your use-case whether that makes sense or not, so let's use an example ...
user avatar
1 vote

Asynchronous Programming in Functional Languages

Functional programming is about sharing information through function composition, recursion but not through shared state/memory. In other words, move semantics would be considered purity preserving in ...
user avatar
7 votes

Should I use unnecessary function for readability sake

Possibly yes, but in this case no —- because your extra functions don’t make your code more readable. const renderNavBar = (size ==='small') ? renderMobileNavBar : renderDesktopNavBar; /* whatever*/ ...
user avatar
  • 10.4k
14 votes
Accepted

Should I use unnecessary function for readability sake

We do a lot of things in programming just for the sake of readability - like giving variables meaningful names (instead of just naming them a, b, c, d, ...). Or specificially conditionals - there is a ...
user avatar
  • 185k
0 votes

How to model transactions in a client-side functional DDD?

An aggregate is supposed to ensure the invariants of a group of related entities and value objects. It seems therefore perfectly ok to have transactions in the repository when persisting the ...
user avatar
  • 67.8k
0 votes

How to model transactions in a client-side functional DDD?

The first one is regarding transactions: My understanding is that transactions are a responsibility of the application layer, That's my understanding as well. Certainly not something to do in the ...
user avatar

Top 50 recent answers are included