Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
U

User 10247229

@User 10247229
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • F# usage
    U User 10247229

    I use F# for everything I can without getting in trouble. (I'm supposed to be using C#.) It has many features that make common programming operations easier, but that are not available in many mainstream languages (including C#), for example: - Automatic type elision (C# has this with var keyword, but in F# it's somewhat more powerful and can identify function types, etc) - Discriminated union types (i.e. a value that can be either THIS or THAT, but not both)

    type GameResult =
    | Winner of playerName: string
    | Stalemate

    - Record types - easy copy-and-update syntax and automatic structural comparison

    let youngBiff = { Name = "Biff Tannen"; Age = 18 }
    let oldBiff = { youngBiff with Age = 73 }
    youngBiff = oldBiff // false

    It's also great for scripting. You can easily run and test individual code lines, functions, etc. in F# interactive. It is definitely multi-paradigm -- it's "functional first", but I also prefer writing OO and imperative code in F# because of features such as the ones mentioned above. I wish F# would supplant C# (or at least gain parity) as the premier .NET language. I don't think there's anything C# does better (except this). But alas, it seems like we're more likely to see C# slowly turn into F# with curly brackets, semicolons, and superfluous type definitions.

    The Lounge question

  • c# Const vs. Readonly, Scope, Usings
    U User 10247229

    I'd like to see the let keyword added to C# for this purpose, to replace var in cases where the binding will not be mutated. Swift makes this distinction, and F# uses let with this meaning (and let mutable for what C# calls var). It also just feels really good, like a benevolent ruler. The variable wants to have this value, and you just have to let it. const is what JavaScript uses for non-mutable bindings, but in C# it already specifically refers to compile-time constants in C#. Also, const just doesn't feel as good as letting a variable follow its heart.

    The Lounge csharp database visual-studio business json

  • What programming language would you want to learn?
    U User 10247229

    F# is pretty awesome. It's a functional-first language with access to all the .NET APIs you know and love. It's also just a really good language. Compared to C#, it makes lots of common and useful things easy to code (collection literals, record types, discriminated unions), and has some particularly powerful and interesting advanced features (computation expressions, type providers). There are lots of other interesting languages (Swift, Rust, and Clojure are high on my list as well), but especially if you're comfortable in the .NET/Visual Studio world, F# is really outstanding. (End fanboigasm)

    The Lounge question csharp javascript python com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups