Avoiding type annotations makes it easier to change the type of data. Even in your example (which has very few variables) you need to change two places in the Java code if you update your SuperEngine to a StableEngine.
If you write your F# code in the same way as your Java code, i.e.

1
2
3
4
let engine = new SuperEngine in
  engine.doThis 1;
  engine.doThat 2;
  engine.doSuperStuff 3

then you only need to change the let binding. You may even get away with a simple

1
type SuperEngine = StableEngine

when you do your upgrade, in which case you can leave all your code unchanged.

That's just one advantage. Personally I feel I will have a hard time going back to C++. There is just way too much text you have to write that doesn't do anything at all.

By on 9/20/2008 5:30 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper