1

I'm digging F# and enjoying writing code in massively different ways.

But I'm confused - why the non #light syntax exists if it is superior to the default syntax?

Does anyone know why?

Why not make #light default and allow a #dark option for those wanted whitespace inspecific code?

Chris Barlow
  • 3,274
  • 4
  • 31
  • 52
CVertex
  • 17,997
  • 28
  • 94
  • 124

3 Answers3

11

It is the default in the latest CTP release and will be when it is in the box for Visual Studio 2010.

While most developers agree with you that #light is a more pleasant coding experience, not everyone shares your love. Moreover, having whitespace aware code also makes some tasks such as code generation MUCH more difficult. (Think lambdas inside of lambdas.)

I suspect the non-#light won't be discussed or seen in the wild, but will certainly exist for people who come from a heavy OCaml background or have some religious issues with #light.

Chris Smith
  • 18,244
  • 13
  • 59
  • 81
  • There are also those of us who did FORTRAN before it became form-free and have an irrational fear of having to punch each line of code starting at column 8 again... Took a while to get used to whitespace sensitivity. – Alexander Rautenberg Feb 12 '12 at 10:11
4

The non-light syntax exist for OCaml compatability. F# takes some code for libraries directly from OCaml and also is supposed to be compatible with OCaml. If you want to port code you just use non-light. As stated in the previous answer #light will be the default in the final release.

Stilgar
  • 22,354
  • 14
  • 64
  • 101
3

Just in case you missed that, you can find some more thoughts about the #light syntax in another post here on StackOverflow. It explains some reasons why non-#light syntax may be interesting.

Community
  • 1
  • 1
Tomas Petricek
  • 240,744
  • 19
  • 378
  • 553