|
Lumpy posted:As someone just starting to look into functional programing, which ones are the "impure" ones? Why are they only "functional-ish"? Why should I avoid them?
|
# ¿ May 1, 2015 19:33 |
|
|
# ¿ Apr 28, 2024 22:13 |
|
For the most Robust, Scalable Enterprise Solution you should use a time service. http://www.timeapi.org/utc/mon?format=%25A
|
# ¿ Sep 17, 2015 18:59 |
|
Good Will Hrunting posted:Is "cake pattern" the only way to mock out something like this? I need to mock out MaxmindDatabases.getConnectionTypeResult in a unit test but you can't mock objects. I guess another option is to create a companion object of the class and access it like that? I'm brand new to Scala so I really can't evaluate tradeoffs of such things too well. I don't think the cake pattern will help here. If you're new to scala, you're better off pretending the cake pattern doesn't exist. The solution is the same as other languages: 1. Create a trait (interface) containing the public API 2. Accept an instance of the trait instead of referencing the singleton object 3. Use a mock implementation in your tests code:
|
# ¿ Mar 30, 2017 05:44 |
|
Beamed posted:Does Twitter use Scala anymore? IIRC they started moving away from it at some point. They're still using it
|
# ¿ Jul 23, 2017 03:37 |