Hacker Newsnew | past | comments | ask | show | jobs | submit | physPop's commentslogin

+1 F# is criminally under-used


I've used it, and am still using it, to generate lots of value in a very large org. Having a language where I can bring Go, Node, etc developers over and get relatively better performance without having to teach OOP and all the implicit conventions that are on the C# side is a bit like a cheat code. With modern .NET, its better than Java perf, with better GC, and having the ability to code generic Python/JS looking code whilst still having type checking (HM inference). There are C# libraries we do use but with standard templates for those few with patterns to interface to mostly F# layers you can get very far in a style of code more fitting of a higher more dynamic language. Ease of use vs perf, its kind of in the middle - and it has also benefited from C# features (e.g. spans recently)

Its not one feature with F# IMO, its little things that add up which generally is the reason it is hard to convince someone to use it. To the point when the developers (under my directive) had to write two products in C# they argued with me to switch back.


I used it for many years but ended up switching to C#. The language needs better refactoring tools. And for that it needs something like Roslyn. The existing compiler library is too slow.


That would be nice, but refactoring canonical F# is still far easier than C# due to its referential transparency.

https://dev.to/ruizb/function-purity-and-referential-transpa...


No, it is not. Referential transparency <<< tooling.

Plus F# as a functional language has significant gaps that prevent effective refactoring, such as lack of support for named arguments to curried functions.


Can you give me an example where lack of support for named arguments to curried functions makes refactoring difficult? I'm having trouble understanding how that would happen.


For one there's no way to add a curried parameter without doThing4-style naming and lack of named arguments implies you can't have a default value for the new parameter.

Another one is if you want to add a curried parameter to the end of the parameter list, and you have code like

  |> myFunc a b
  |> ...
You can't just say

  |> myFunc a b z=10
  |> ...

instead, you have to rewrite the whole pipe.


OK, I think I see what you mean. I certainly agree that named arguments with default values can be useful, but are not supported by curried functions.


honestly 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.


I 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?


It’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


exactly. people delude themselves thinking this is productivity. Tweaking prompts is to get it "right" is very wasteful.


it really doesn't take that long. Maybe if you're super junior and never coded before? In that case I'm glad its helping you get into the field. Also, if its taking you months there are whole new models that will get released and you need to learn those quirks again.


No, it's a practice. You're not necessarily building technical knowledge, rather you're building up an intuition. It's for sure not like learning a programming language. It's more like feeling your way along and figuring out how to inhabit a dwelling in the dark. We would just have to agree to disagree on this. I feel exactly as the parent commenter felt. But it's not easy to explain (or to understand from someones explanation.)


How very condescending of you.


Because over the course of a billion years of history, evolutionary pressures essentially end after child-rearing ages.


clippy is kind of taken (a very popular rust linter). Suggest considering a new name to differentiate yourself!


Safari is also not adblocker friendly. Lots of other entrants to try though. Brave in particular is great!


But Brave is a Chromium browser, which is out of scope according to the comment.


Adguard works fine? How are they not friendly?


Brave == Chrome


Yes because injecting nowFn is trivial and not a case for DI. Consider a database handle, or network socket, or http response payload. Clearly each class shouldn't be making its own version of those.


You're right, stateful dependencies like DB handles need to be passed in manually, and that's a bit of extra legwork you need to do.


Just use a static variable to the DB instance / pool, maybe using singletons, so everyone needing it have access.


You're nitpicking for no good reason. You can create global handles to each of those items, and let them instantiate with the class or override them with a create function.

Dependency injection boils down the question of whether or not you can dynamically change a dependency at runtime.


I disagree -- the funding isn't ROI based at all. Heck NIH doesn't even really audit how well the funds were spent, how could they? They don't even really assess if the research had impact, save for counting journal articles and impact factors, which are in themselves poor proxies for quality of work (and easily gamed).


What makes you say all that? Grants are hard to get, highly competitive with difficult standards.


This isn't law, its journalism, and frankly the article is well written and asks a good question -- why are these (extremely wealthy) universities finances so brittle?


The question is self-answering as soon as you read the first two sentences though.

> Columbia...has an endowment of roughly $15bn. Mr Trump’s administration withheld a mere $400m in federal funding.

With the best investing in the world, that $15bn might throw off 1 billion a year in perpetuity. $400m (a year) is a very serious chunk of the university's budget.


Exactly... Scaling the numbers down: It's as if a person has $1.5M net worth, and their investments produce $100K per year. They are also simply being handed $40K per year from someone they disagree with, but who otherwise reliably provides that income. Are they just going to turn that money down because of this ethical disagreement? A lot of people wouldn't.


Or alternatively, their investments from one account produce $100K per year, their investments from another account (non-Federal grants) produce an unknown amount, and they have a job (tuition payments) that produces another unknown amount. How significant is 40% of the 100K?

We don't know unless we fill in the unknown numbers. Knowing that the amount of federal aid being removed is 40% of an estimate of the amount produced by one source (the endowment) isn't enough information to answer the question. The right question is what percentage of their budget this represents.

From what I can tell, Harvard's actual annual budget is about $6.5B (https://www.harvardmagazine.com/2024/10/financial-report-fis...). A $400M shortfall is thus about 6% of their annual budget. Significant, but also something they could probably cover for the next decade or two by drawing down their endowment until they adjust.


It isn't law, but why does the principle exist in law? That's what I'm asking you to think about. Why would judges who have to make decisions about people's lives do this? Is there a good reason for it?

Yes there is.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: