hepta | 8 years ago | on: Mark – A simple and unified notation for both object and markup data
hepta's comments
hepta | 8 years ago | on: Effective Programs: 10 Years of Clojure
hepta | 8 years ago | on: Effective Programs: 10 Years of Clojure
I only have my experience (which is about 1/4 of his) to lean on. And I've only had problems when protocols are not well understood by all parties, never the opposite. Talking in the level of ADTs (or some representation that is equally precise) tends to either clear things up, or uncover problems that were not obvious in informal discussion.
hepta | 8 years ago | on: Diminishing returns of static typing
hepta | 8 years ago | on: Code Smells: Iteration
Using a Stream instead of a for loop does very little to make your code incompatible with C. It is already pretty much incompatible (modulo JNI).
What I mean is: if you want something that looks like C just use that, there is no gain in not learning new constructs just because older languages did not have them.
hepta | 8 years ago | on: 3-year-olds consuming alternative milks were 1.5 cm shorter on average
This is in constrast with chicken eggs, which I believe can be ethically produced (even though they aren't in the large majority of the industry).
hepta | 8 years ago | on: ReactOS 0.4.5 Released
hepta | 9 years ago | on: Pattern Matching for Java
hepta | 9 years ago | on: Pattern Matching for Java
hepta | 9 years ago | on: Problems with Kotlin
hepta | 9 years ago | on: The State of Go
hepta | 9 years ago | on: A practical introduction to functional programming (2013)
That's fair. What I often want is to pull a function out of my program and test it without a lot of work. This is easy if the function is pure.
> My point is that hidden state is not bad when the explicit simulation of state is cumbersome to use.
That depends on your goal. If your intention is to make state explicit, then by definition there has to be more code to make it so. Again, a preferable abstraction for this makes the boilerplate go away, while keeping everything pure. That added effort gives you testability but I know there are instances where that effort is not worth it.
hepta | 9 years ago | on: A practical introduction to functional programming (2013)
hepta | 9 years ago | on: A practical introduction to functional programming (2013)
The other risk is that people (like me, a few years ago) are sufficiently convinced by these simple loop examples that they decide to apply them. This might (or might not) lead to greater functional aspirations which make "whole picture" much more interesting. You might get to free monads, but not before you've used a fold on a list.
hepta | 9 years ago | on: Seven years of Go
hepta | 9 years ago | on: The advantages of static typing, simply stated
Regarding your rating example, you could encode that restriction in a type (or class in OO) and have a guarantee that once you have an instance of that type you no longer need to check for it's validity. Rendering a Rating would never fail at runtime, you'd get a type error first.
hepta | 9 years ago | on: The advantages of static typing, simply stated
hepta | 9 years ago | on: Advantages of Functional Programming in Java 8
hepta | 9 years ago | on: Advantages of Functional Programming in Java 8
Yes, it's strange. I'd prefer to map a null in a DTO to an empty optional. I'd like even more to never have nulls in the dto in the first place.
hepta | 9 years ago | on: Advantages of Functional Programming in Java 8
Similarly, methods for mutation (compulsory, no less!) are red flag in FP.