7 ms·
Yes, I've heard a lot of praise around F# and its power. I've been meaning to get into it. Coming into it cold, though, I found the syntax a bit cryptic, but th
by aashishkoirala 13y ago
Yes, I've heard a lot of praise around F# and its power. I've been meaning to get into it. Coming into it cold, though, I found the syntax a bit cryptic, but that's probably just me. I do plan to power through, though.
In terms of differences with Java (and limiting this to just the language and the syntax), LINQ is a good example of it :) I guess you could classify a lot of the other differences as synctatic sugar, but those little things add up and make a real difference in terms of code brevity, readability and developer productivity. To name a few (and I know that Java, especially with v8 has started adding support for some of these): Properties (and auto-properties), Delegates, Events, Lambdas/Anonymous Functions/First Class Functions, Extension methods, "using" for IDisposable (although Java 7 has something similar in AutoClosable), the lack of forced checked exceptions, the newly added async/await keywords, object and collection initializers and anonymous types, etc.
- doorhammer 13y agoAwesome, thanks. F# is definitely a nice language. I haven't done any large scale projects in it, but what I have done has been very nice. Check out type providers if you haven't already. They're really interesting and handy. I switched over to F# as my side/fun language from Clojure when my day-job became .NET. It's not that I'd say they're equivalent languages, but the way of thinking about most things was similar enough that it felt right. On top of that, it was nice having a fairly strong type system to back things up. It meshed more with how I think about things. Hah, I probably should have assumed LINQ would top the list of a linq post. I remember before I knew what LINQ was about. Once I started using it, it quickly became one of my favorite parts of the language/ecosystem. I really do feel that the things you've mentioned do make it a much cleaner and more consistent language than Java. I've got a friend who switched from full time Java to C# recently. I'll have to see what he thinks as well.