Captcha for phone calls. (Something I threw together this afternoon)
Submitted June 24, 2017 at 05:52PM by brendanmyers
via reddit http://ift.tt/2tFeKZb
How Do I Code Movement
Hey guys how do I code movement in a game, their is no animation all I want to know is how to move left, right,jump and how to very the speed for different characters
Submitted June 24, 2017 at 04:58PM by Steel_Fox_
via reddit http://ift.tt/2t5ROFE
Practical functional design in Scala?
Hi people, I want to share some thoughts I collected so far while trying to understand intended way to use Scala.
Cases I've seen so far are:
Some facts about Dotty sources:
Most code is organized in functions or methods with following signature:
def fun(arg1, arg2...)(implict ctx: Context): Result
Where Context is huge object combined from many traits which serves two functions:
So, what do I want to say…
Twitter-style OOP is solid and well-known with well-known problems of object aggregation – that to get working code we need to assemble large object tree. Which complicates code isolation and testing
Haskell-style uses excess CPU/GC which makes it less practical for writing fast software. Also it is quite complicated to write and understand.
Dotty takes another approach by separating data, algorithms and configuration. Naive approach to write code as functions is not that flexible: given
def f(v: Int) = g(v)
you can't add new argument to g() w/o adding new arguments to entire call stack, you can't replace g() with another implementation except for passing it as function argument both for sake of configuration or testing.
Implicits won't really help because they are resolved by type – to provide implicit instances, caller must have them as implicit parameters, import them or pass them directly to second argument list.
Context type helps but is that really the best way? It breaks encapsulation by feeding functions more data than they need, it must be assembled correctly for unit tests, it shadows real dependencies of the function. Other issues are described there in scaladoc: http://ift.tt/2s6tdve
Well. Can dotty sources be used as an example of intended design for Scala applications? Is there better way to manage dependencies in programs that are composed of functions and not of objects? What design do you use?
Submitted June 24, 2017 at 02:20PM by Scf37
via reddit http://ift.tt/2tF38FA
Dependency Injection Explained – Doing a video series on important design patterns, would appreciate feedback!
Submitted June 24, 2017 at 02:19PM by ArkhitektonYT
via reddit http://ift.tt/2t1EyRz