0%

《F# for fun and profit》2.Guildlines

General guidelines for troubleshooting

  • Don’ts
    • Don’t use the mutable keyword at all as a beginner
    • Don’t use for or if-then-else, use pattern match
    • Don’t use “dot notation”, try use function for everything
    • Don’t create class, use pure F# types such as tuples, records, and unions
    • Don’t use the debugger! Use your brain.
  • Dos
    • Do create lots of “little types”, especially union types
    • Do understand list and seq, like List.fold and List.map
    • Try avoid recursion
    • Do use pipe( |> ) and composition( >> ) as much as you can
    • Do understand how partial application works, and try to become comfortable with point-free (tacit) style
    • Do develop code incrementally, using the interactive window to test code fragments