2,772 reputation
1230
bio website
location Argentina
age 38
visits member for 3 years, 11 months
seen 9 hours ago

Software developer and science fiction fan.


9h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Fuhrmanator A customer can still write one-line user stories and business rules regardless of whether you use OOP and FP. I don't expect customers to understand higher-order functions any more than I expect them to understand inheritance, composition or interfaces.
10h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Fuhrmanator No, this is a case where you cannot wing it. You must study FP, get into the mindset, and then you'll be able to judge it by yourself. What you are asking is akin to "show me why speaking $NATURAL_LANGUAGE is beautiful. Give me some examples." But that's not how it works -- make the effort to learn $NATURAL_LANGUAGE and judge by yourself. And do read the paper I linked to; it's extremely interesting and the first few paragraphs are likely to clear some misunderstandings about what FP is and why people think it's useful.
10h
comment Does functional programming increase the 'representational gap' between problems and solutions?
In the same line as @JimmyHoffa's comment, I recommend you read the seminal paper Why Functional Programming Matters (fully available online). Read the first paragraph of the conclusion: it addresses how FP helps with modularity, which the author singles out as (one of) the most important aspects of software development. (And yes, in some respects FP is more modular than OOP).
12h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@StefanoSanfilippo Do note that hybrid approaches also have their weak points, and there are valid reasons to "go pure" :)
12h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Doval That's how a Haskeler friend told me to start working on a Haskell function: sprinkling "undefined"s wherever I don't have an implementation yet :) It seems top-down to me.
13h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Fuhrmanator But you do know where to find a function. And there is only one function, not multiple functions with the same name, defined for each datatype (again, see the "Expression Problem"). For example, for Haskell library functions (which you're encouraged to use, instead of rediscovering the wheel or making a slightly less useful versions of said functions), you have wonderful discovery tools such as Hoogle, which is so powerful it lets you search by signature (try it! :) )
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Den I can't tell what either of those functions do. However, I can tell you if the first function in FP was a sort or a filter, it would be named filter or sort, not func (just like you named it IFilter, etc). In general, in FP you'd name it func or f when either sort or filter is a valid choice! For example, when writing a higher-order function that takes func as a parameter.
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Den The popularity you describe is, I'm afraid, an accident of history. I use Scala at work, and it's a complex beast due to the way it attempts to mix FP and OOP. Switching to a true FP language like Haskell feels like a breath of fresh air -- and I'm not talking from an academic perspective either!
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@BenAaronson That's a very OOP point of view :) With FP, you tend to generalize traversals over stuff, and pass the specific work as a function parameter. In this way, you tend to reduce duplication: there are no multiple ways to do similar things spread over Student, Course, and/or their helpers. AOP seems like a solution to an OOP problem.
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Fuhrmanator True, in the sense you're talking about, both OOP and FP are low-level. But how does this relate to the "representational gap"?
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Fuhrmanator More or less what Doval said: neither "OOP abstractions" nor "FP abstractions" trace back to elements of the problem space directly. The "problem space" is independent of the programming paradigm you choose. It's hard to understand what your actual question is... If you're trying to solve something about Courses and Students, you'll probably think in those terms; and maybe something "clicks" in your mind and you realize the problem can be generalized even further. That's orthogonal to OOP or FP!
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Den See also Erik Meijer's "'Mostly Functional' programming doesn't work", which argues against the hybrid approach and for going full "fundamentalist" FP.
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Den Hybrid approaches have their merits. It's not true, however, that the distinction is artificial. There are lots of compromises Scala had to make in order to fit OOP and FP (less powerful type inference is one. Complexity is another: yes, a language that mixes OOP and FP tends to be more complex -- as in "hard to use and understand" -- than one of its purer brothers on the two extremes).
18h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@BenAaronson I find FP more reusable/composable than OOP. Instead of an ad hoc method on a Student class, you have general functions performing general computation whenever you can. Doing some work on a list of Students and returning a filtered result is a typical FP computation that can be applied to almost anything. Why put it in a Student class, unnecessarily constraining yourself? And what if you don't need to give a name to the work you're doing on the Student? Why have a method at all?
19h
comment Does functional programming increase the 'representational gap' between problems and solutions?
@Hey Giorgio is likely referring to the so-called Expression Problem. "Adding new formats" means "adding new constructors (aka 'cases') to a datatype".
1d
comment Does functional programming increase the 'representational gap' between problems and solutions?
I think the problem is that you're more familiar with OOP than with FP. There is little "natural" about the way OO models problems; it's a learned formalism. If you had started with FP, you'd probably be asking the inverse.
Jan
23
comment Enum as singleton or fully functional class
@Heisenberg It doesn't matter what enum's original purpose was. This is something that was found afterwards: that it's the safest way to write singletons. All other ways are error-prone or bugged in subtle ways.
Jan
21
reviewed Approve RavenDb - Get data through a REST Web API
Jan
19
comment When does pair programming work? When to avoid it?
@Giorgio Agreed. I actually support partial Pair Programming: tackling some hard problems in pairs. But some advocates think it should be used most of the time for most programming tasks, which I disagree with.
Jan
16
comment How to do Test Driven Development
@JörgWMittag Correct me if I misunderstood you, but are you saying that Ron Jeffries was doing "pseudo-TDD"? Isn't that a form of the "no true Scotsman" fallacy? (I agree with you about the need for more scientific studies; the blog I linked to is just a colorful anecdote about the spectacular failure of a specific instance of TDD usage. Unfortunately, it seems as if the TDD evangelists are too loud for the rest of us to have a real analysis of this metholody and its alleged benefits).