Functional programming is a programming paradigm which makes it easy to create, reason about, and compose functions.
2
votes
1answer
75 views
Guidelines for creating referentially transparent callables
In some cases, I want to use referentially transparent callables while coding in Python. My goals are to help with handling concurrency, memoization, unit testing, and verification of code ...
6
votes
5answers
279 views
What's the proper term for a function inverse to a constructor - to unwrap a value from a data type?
Edit: I'm rephrasing the question a bit. Apparently I caused some confusion because I didn't realize that the term destructor is used in OOP for something quite different - it's a function invoked ...
2
votes
3answers
87 views
Internal Mutation of Persistent Data Structures
To clarify, when I mean use the terms persistent and immutable on a data structure, I mean that:
The state of the data structure remains unchanged for its lifetime. It always holds the same data, ...
8
votes
8answers
856 views
Why isn't functional language syntax more close to human language?
I'm interested in functional programming and decided to get head to head with Haskell. My head hurts... but I'll eventually get it...
I have one curiosity though, why is the syntax so cryptic (in lack ...
5
votes
5answers
284 views
When to use functional programming approach and when not? (in Java)
let's assume I have a task to create a Set of class names. To remove duplication of .getName() method calls for each class, I used org.apache.commons.collections.CollectionUtils and ...
5
votes
1answer
191 views
Why does Scala require functions to have explicit return type?
I recently began learning to program in Scala, and it's been fun so far. I really like the ability to declare functions within another function which just seems to intuitive thing to do.
One pet ...
10
votes
2answers
258 views
Are there any specific workflows or design patterns that are commonly used to create large functional programming applications?
I have been exploring Clojure for a while now, although I haven't used it on any nontrivial projects. Basically, I have just been getting comfortable with the syntax and some of the idioms. Coming ...
10
votes
2answers
171 views
FP for simulation and modelling
I'm about to start a simulation/modelling project. I already know that OOP is used for this kind of projects. However, studying Haskell made me consider using the FP paradigm for modelling a system of ...
4
votes
3answers
248 views
From Imperative to Functional Programming
As an Electronic Engineer, my programming experience started with Assembly and continue with PL/M, C, C++, Delphi, Java, C# among others (imperative programming is in my blood).
I'm interested in ...
4
votes
2answers
110 views
How to have a maintainable and manageable Javascript code base [closed]
I am starting a new job soon as a frontend developer. The App I would be working on is 100% Javascript on the client side. all the server returns is an index page that loads all the Javascript files ...
10
votes
1answer
279 views
Equivalent of SOLID principles for functional programming
I've found the SOLID principles quite useful when thinking about object-oriented design.
Is there a similar / equivalent set of language-agnostic principles tailored for functional programming?
-3
votes
2answers
193 views
Should a new programmer nowadays start with C/C++ or OOP language? [closed]
I've been a programmer for 15+ years. In my time, we all started with C or C++ and then moved to C# or Java. At that time it was a usual practice.
Now, my brother wants to follow my steps and I am ...
17
votes
6answers
1k views
Is functional programming a superset of object oriented?
The more functional programming I do, the more I feel like it adds an extra layer of abstraction that seems like how an onion's layer is- all encompassing of the previous layers.
I don't know if this ...
4
votes
6answers
425 views
Functional programming readability
I'm curious about this because I recall before learning any functional languages, I thought them all horribly, awfully, terribly unreadable. Now that I know Haskell and f#, I find it takes a little ...
7
votes
3answers
276 views
Why is the rec keyword needed in F#?
In F# it is necessary to use the rec keyword. In Haskell there is no need to explicitly tell if a given function is recursive or not.
Given the role of recursion in functional programming, the F# ...