Tagged Questions
27
votes
7answers
4k views
Is Functional Programming possible in Java?
I was browsing through the Amazon.com Bookstore and I came across the book "Functional Programming for Java Developers".
I know some very basic Functional Programming and have been programming in ...
15
votes
10answers
2k views
How to write useful Java programs without using mutable variables
I was reading an article about functional programming where the writer states
(take 25 (squares-of (integers)))
Notice that it has no variables. Indeed, it has nothing more than three ...
11
votes
1answer
623 views
Reasons for removal of function types in Java 8
I have been trying to understand why the JDK 8 Lambda Expert Group (EG) decided not to include a new function type into the Java programming language.
Going over the mailing list I found a thread ...
10
votes
5answers
904 views
How to code in a more functional style in Java?
I code Java for at least 5 years now and I really appreciate how the language works. When looking at new JVM languages (e.g. Scala, Clojure) there is a trend to more functional ways to code and this ...
9
votes
6answers
593 views
Is there an infinite amount of knowledge in a programming language?
I can program in Java, C#, C, Scala, and Javascript fluently. I'm comfortable with Objective-C, but I don't remember the conventions used for memory management. I can read Python and Ruby and I've ...
8
votes
11answers
1k views
Is Object Oriented stuff really that important? [closed]
For years, I have been doing Algorithmic stuff, writing scalable data structures for internet search, for example Randomized Binary Search Trees for Auto Recommendation, BitMaps, Wisdom of Crowd based ...
7
votes
2answers
321 views
implement cons function in Java - type safety question
I am working on a small functional library written in Java, which mimics the a functional style of programming. I am stuck with a undesirable type cast in one of my method definitions and would love ...
7
votes
2answers
599 views
Does reflection in Java make its functions “first class”
I am always hearing people talk about how Java does not support first class functions, that it is an advantage you get from functional languages, the only way to simulate it in Java is through the use ...
5
votes
5answers
509 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 ...
4
votes
5answers
393 views
Java memory management (thunks/lazyness)
If I want to create an infinite list of integers in Java like so:
ArrayList<Integer> list = new ArrayList<Integer>();
for(int i = 0;;i++){
list.add(i);
}
I run out of memory. My ...
0
votes
3answers
359 views
Is imperative style programming (say with Java/C) more error prone than something more declarative
I know programmers tend to get defensive with their paradigms and tools that they use. But in your experience, with the most generic, typical pieces of code that you see with Java or C++ or C, is the ...