How are you trying to make your code functional?
I focus on making things immutable. Immutable objects make thinking about multithreaded code much easier than thread-protected objects. An object has one visible state that can be passed between threads without any synchronization. This requires multi-threaded programming.
If you're interested, I've posted most of my work with immutable objects, in particular immutable collections, in the code gallery. Project name RantPack . In the collection area I
- ImmutableCollection <T>
- ImmutableMap <TKey, TValue>
- ImmutableAvlTree <T>
- ImmutableLinkedList <T>
- ImmutableArray <T>
- ImmutableStack <T>
- ImmutableQueue <T>
There is an additional shim layer, which is (CollectionUtility), which will create wrapper objects that implement BCL interfaces such as IList <T> and ICollection <T>. They cannot fully implement interfaces as they are immutable, but all possible methods are implemented.
Source code (C #) including unit testing is also available on the site.
source to share
I am programming mostly in Java. I am patiently waiting for the day when closures are added to the language. But since I am still sticking with Java 1.4.2, even if they are added it won't be for me for a long time!
However, my main "functional" way of programming heavily uses the "final" keyword. I try to keep as many classes as possible completely immutable, and for the rest there is a clear distinction between what is temporary and what is immutable.
source to share
It talks about rubyconf 2008 on the subject, mostly in ruby, but a few concepts remain valid.
http://rubyconf2008.confreaks.com/better-ruby-through-functional-programming-2.html
source to share