Alois Kraus

blog

  Home  |   Contact  |   Syndication    |   Login
  40 Posts | 8 Stories | 149 Comments | 165 Trackbacks

News



Article Categories

Archives

Post Categories

Image Galleries

Programming

 Robert did write about my F#/C# article where he states that F# is as easy to learn as any other imperative language.
My final comment was:
Not all concepts of functional languages should be explored by Mort and Elvis since most of them are fairly complex to understand because functional languages are very picky (just like unix) who can be their friend and who not. If Einstein does write a F# program then only a true Einstein can maintain it. When the outsourced Mort and Elvis do change his code I am sure they will screw it up
He does argument that any complicated problem will result in more or less complex code which is difficult to understand. F# is much clearer and does require in many cases less code to write. This is true. But since F# and C# are different languages what is the difference anyway? Here is the catch: The F# language itself was designed to allow scientists to write complex algorithms with few lines of code. Humans with high mental capabilities see the immediate value of short and concise code that does not distract the reader with unnecessary syntactic language elements. This high value is at the same time it's Achilles heel. The language is only useful if the code is short and concise. If Einstein plays nice with Mort and Elvis he would comment the code. Every function should be described what its purpose is, what the input variables are and what the result is. But since there are so much more functions defined F# source code  this task of thorough documentation is not very practical. The other problem I have with F# is that there are so many implicit conventions you have to know. Where does the program execution start in a F# project with 50 files? Grep for main? Einsteins have no problems with syntax. All is clear to them. But Mort and Elvis will struggle with the syntax of a language where no explicit main, no explicit function end does exist. The C# syntax is perhaps bloated but at least it makes things much more explicit which is a good thing for the people who have to understand not your algorithm but the overall program structure. Nonetheless I will continue to explore F# because it does help to look at many problems from a different perspective where it does offer some remarkably easy solutions.
posted on Tuesday, May 30, 2006 9:50 PM

Feedback

# re: Is F# Code easy to understand? 5/31/2006 2:02 AM Greg Young
I have to admit it took me a while to _get_ functional languages (and I still don't _really_ get them but can hack my way through). The effort is well worth it though when you have a situation that calls for their types of behavior.

# re: Is F# Code easy to understand? 6/1/2006 8:44 PM Robert Pickering
Hey Alois, this is a good answer!

I agree with you that there is danger, that some one who _thinks_ they really clever might spew out a massive code base and leave it behind hoping that some one else will clean up there mess, but I also think this can happen in any language. To write good maintainable code, it does not matter if you are an Einstein, you have to document as you go along.

I also agree that there maybe problems scaling projects written in F#, my gut feeling that a language with explicit typing, C#, will work better when a code base is shared between a large group of developers and an implicitly type language, F#, works better when the group of developers is relatively small.

Having said that linspire recently announced they where going to do most of there development in Haskell (http://lambda-the-ultimate.org/node/1506). It will be interesting to see how this projects develop as they are shared between the large number of developers in the Linux community.

I disagree too that F# projects won’t scale, the F# compiler and libraries come to about 250 files, but the team seems to be able to maintain them and add new functionality. Then again, the team is pretty small and very smart.


# re: Is F# Code easy to understand? 5/8/2009 8:23 AM dan meismer
F# code is easy to understand in the sense that it allows you to write your program clearly and concisely, moreso than in other languages.

F# code is difficult to understand is the sense that you must first learn some advanced programming techniques (compared to c#) in order to understand what is going on.

Thus, the average programmer will not be able to understand an F# program.

Hiring managers may be reluctant to adopt F# because it limits how far they can treat programmers as commodities. [As opposed to the Java world, which is designed for this]

However, if one F# programmer is as productive as 2-3 C# programmers, and I suspect this will be true, then management will have to...well this is just simple math.


I believe the big factors in the success of F# will be:
1. The number of people that take the time to learn functional programming concepts.
2. Companies having strange legacy codebase situations that prevent F# from being viable (despite its .NET integration).
3. IT managers being good at math.
4. People being willing to try something new.


#4 is the biggest one, I think. Programmers aren't much different from everyone else in the world, except they know how to tell computers to do things. They rarely change.

So what do I think? I have no idea, but I think learning F# will give me a competitive advantage. Even if I never get to use it, it will make me a better programmer.



# re: Is F# Code easy to understand? 10/21/2009 5:14 PM Jarle Stabell
I agree with you that you must first learn some new programming techniques (compared to c#) in order to understand F# code. However that doesn't mean the average developer will never be able to understand an F# program, only that he/she will need to spend a couple of weeks learning the new concepts and syntax first. I think it is a widely (and correctly) held belief that learning a programming language is quite easy, it is learning all the libraries, frameworks, patterns, idioms etc which takes a lot of time, not learning the language itself.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: