9 ms·
> C# is, imo, the best cross platform GC language. I really can't think of anything that comes close How about F#? Isn't F# mostly C# with better ergonomics?
by grumpyprole 1y ago
> C# is, imo, the best cross platform GC language. I really can't think of anything that comes close
How about F#? Isn't F# mostly C# with better ergonomics?
- denismenace 1y agoHe means the runtime ".NET CLR". They have the same runtime.
- Xss3 1y agoLmao, functional programming is far from ergonomic
- samus 1y agoThat really depends on your preferred coding style.
- grumpyprole 1y agoF# is hardly modern functional programming. It's more like a better python with types. And that's much more ergonomic than C#.
- ZenoArrow 1y agoPython and F# are not very similar. A better comparison is OCaml. F# and OCaml are similar. They're both ML-style functional languages.
- grumpyprole 1y agoI'd much rather code F# than Python, it's more principled, at least at the small scale. But F# is in many ways closer to modern mainstream languages than a modern pure functional language. There's nothing scary about it. You can write F# mostly like Python if you want, i.e. pervasive mutation and side effects, if that's your thing.
- ZenoArrow 1y agoIf Python is the only language you have to compare other languages to, all other programming languages are going to look like "Python with X and Y differences". It makes no sense to compare Python to F# when OCaml exists and is a far closer relative. F# isn't quite "OCaml on .NET" but it's pretty close.
- grumpyprole 1y agoIt absolutely does make sense to compare it to the worlds most popular programming language, especially when dismissed as "functional programming". Who benefits from an OCaml comparison? You think F# should be marketed to OCaml users who might want to try dotnet? That's a pretty small market.
- ZenoArrow 1y agoPython is the world's most used scripting language, but for application programming languages there are other languages that are widely used and better to compare to F#. For example, C# and Java.
- grumpyprole 1y agoF# was pitched by Microsoft to be used in areas where Python dominates, especially for scripting in the finance domain and "rapid application development". So it doesn't make sense at all that C# and Java are a "better comparison".
- ZenoArrow 1y ago> F# was pitched by Microsoft to be used in areas where Python dominates Haha, no. Microsoft barely talks about F# at all, and has largely left the evolution of the language up to the open source community that supports it. Furthermore, you shouldn't take your cues about what a language is best suited for from marketing types, you should evaluate it based on its strengths as a language and broader ecosystem. If you seriously doubt that C# is a better comparison to F# than Python, then I suspect you haven't used either C# or F# and you're basing your views on marketing fluff.
- raincole 1y agoIt's so weird to describe F# as "Python with Types." First of all, Python is Python with Types. And C# is much more similar to Python than F# is.
- grumpyprole 1y agoIt all depends on the lens one chooses to view them. None of them are really "functional programming" in the truly modern sense, even F#. As more and more mainstream languages get pattern matching and algebraic data types (such as Python), feature lambdas and immutable values, then these languages converge. However, you don't really get the promises of functional programming such as guaranteed correct composition and easier reasoning/analysis, for that one needs at least purity and perhaps even totality. That carries the burden of proof, which means things get harder and perhaps too hard for some (e.g. the parent poster).
- maleldil 1y agoIf purity is a requirement for "real" functional programming, then OCaml or Clojure aren't functional. Regarding totality, even Haskell has partial functions and exceptions.
- grumpyprole 1y agoBoth OCaml and Clojure are principled and well designed languages, but they are mostly evolutions of Lisp and ML from the 70s. That's not where functional programming is today. Both encourage a functional style, which is good. And maybe that's your definition of a "functional language". But I think that definition will get increasingly less useful over time.
- maleldil 1y agoWhat is an example of a real functional language for you?
- 1y ago
- CharlieDigital 1y agoExactly what I've observed in practice because most devs have no background in writing functional code and will complain when asked to do so. Passing or returning a function seems a foreign concept to many devs. They know how to use lambda expressions, but rarely write code that works this way. We adopted ErrorOr[0] and have a rule that core code must return ErrorOr<T>. Devs have struggled with this and continue to misunderstand how to use the result type. [0] https://github.com/amantinband/error-or https://github.com/amantinband/error-or
- raddan 11mo agoCool. I’ll have to check this out. I often find myself rolling my own “option type” when writing C#. Agreed with getting developers to see the value. The most convincing argument I’ve been able to make thus far has been “isn’t it embarrassing when your code explodes in production? Imagine being able to find those errors at compile time.” The few who actually understand the distinction between “compile time” and “run time” can usually appreciate why you might want it.
- physPop 1y agohonestly this sounds like you've never really done it. FP is much better for ergonomics, developer productivity, correctness. All the important things when writing code.
- Hendrikto 1y agoI like FP, but your claim is just as baseless as the parent’s. If FP was really better at “all the important things”, why is there such a wide range of opinions, good but also bad? Why is it still a niche paradigm?
- raddan 11mo agoIt’s niche because the vast, vast majority of programmers just continue to do what they know or go with the crowd. I spend roughly 50% of my time doing FP and 50% doing imperative (most OOP) programming. I am dramatically more effective writing functional code. Like other posters, I am not going to claim that it is better at all things. OOP’s approach to polymorphism and extensibility is brilliant. But I also know that nearly all of the mistakes I make have to do with not thinking carefully enough about mutability or side-effects, features that are (mostly) verboten in FP. It takes some effort to re-learn how to do things (recursion all the things!) but once you’ve done it, you realize how elegant your code can be. Many of my FP programs are also effectively proofs of their own correctness, which is not a property that many other language styles can offer. Here’s an appropriate PG essay: https://paulgraham.com/avg.html https://paulgraham.com/avg.html
- raincole 1y agoPersonally I love F#, but I feel the community is probably even smaller than OCaml...
- gixco 1y agoI once got a temporary F# role without any F# experience simply by having 7 YoE with C# and the knowledge that F# exists. As much as I'd like to do more with it, the "just use F#" idea flaunted in this thread is a distant pipe dream for the vast majority of teams.
- actionfromafar 1y agoIt is but in practice it’s very hard to find programmers for it.