As Java Programmer, "Where has C# been when I was programming In Java "?

As a certified Java programmer I have been living in the Object world maintaining my states, favoring composition over inheritance and using design patterns until multicore CPU's came into the market. You maybe asking why did multicore cpus disrupt my object oriented world? Here is why - It's time to get good at functional programming. The main thing in the article is the parallelism of functional programming to take advantage of those multi core cpus. Variables and data in functions will not have the side effects (deadlocks, race conditions) that we see in an object oriented language like java because functions only depends on inputs and not on any global state (translation - they only have local variables which is always thread safe). 
So how does this relate to C# ? Well the designers of the C# language was heavily influenced by Haskell (functional programming language. Erik Meijer worked on LINQ in C#). 
I am liking, favoring and talking about C# because of this (even though Java 8 will have lambda expressions lambda expressions

Here are my top three favorites things in C#:

1. Lambda Expressions - (specially used with LINQ)
   lambda expressions are anonymous functions (C# lambda expressions). This makes evaluating collections and enumerations really easy.   
2. Function Types
   a Function is a type (like javascript) you can pass the functions around and create higher order functions.
3. Object Literals
   enough with the get and set methods in Java. (Object literal in C#)

I hope that Java 8 will not disappoint me.


Side Note:

Functional programming had roots from the 1930's from Alonzo Church's Lambda calculus. Hence the term Lambda Expression.

Comments

Popular posts from this blog

OAuth 1.0a Request Signing and Verification - HMAC-SHA1 - HMAC-SHA256

Spark DataFrame - Array[ByteBuffer] - IllegalAurmentException

Gensim Doc2Vec on Spark - a quest to get the right Vector