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

They're doing the same thing with C#. The amount crap they have added to that language over the years is mind boggling - yet, we still don't have sum types which is the one thing that every C# developer I have worked with _really_ wants.


I have mixed views on this. We’ve gotten a lot of good with the bad. I think “C#, the Good Parts” would be a much thicker book than “JavaScript, the Good Parts”


I agree. Most things that got added are good.

I don’t like that there are 3+ ways of checking if a value is null tho.


There’s like 3+ ways to construct an object too.


Have you seen cpp?


That in itself is a critique of C#


Maybe, it's not my favourite language, but it seems basically fine. A new version drops, my five, ten year old code largely still just works and maybe there are improvements I have a use for in new code.

Some of the remaining warts are because it is wedded to the .NET CLR, so if the CLR says you can't do that then, too bad C# can't do that. It would not be practical to do anything about those.


Could you list the features you consider crap?



Yeah, I'd like to see this too...

We're discussing Windows and all its ad-ware/invasive changes, and someone brings up C# without giving a real explanation or examples.

The last few C# versions brought primary constructors, collection expressions, records(!), tons of Span<T> improvements/support, etc. I just flicked through the list, and nothing that stuck out to me as being bloated.

The main bloat C# has is older stuff that you really shouldn't be using anymore (e.g. ArrayList, dynamic, Thread, delegate keyword, etc).


"Bloat" is just shorthand for "things I don't like"/"things I don't find useful". It has no other meaning. Avoid using it where possible.


> We're discussing Windows and all its ad-ware/invasive changes, and someone brings up C#

I brought up C# because the article discusses a Microsoft Windows design philosophy that I feel is also reflected in their approach to C#. It’s a Microsoft thing.

I agree with you that the examples you mention were great additions to the language! But I still think the C# design team has some seriously screwed up priorities. My theory is that this one year cycle they are on is hampering their ability to make changes (like sum types) that require more than a year of work.


Could you give some examples of the bloat they've added to C# that represent their "seriously screwed up priorities" aside from not adding Sum?


See the links I listed above. None of those features solved a language problem as large as the lack of sum types. It baffles me that they even spent time on them before providing a feature that is in such high demand (and has been for more than a decade).

I understand that you shouldn’t always give users what they ask for - but this is something that has picked up steam in other languages because it’s actually useful and makes code bases easier to maintain.


You're projecting your strong opinion on others.

I've used C# since 2008 for business software and high performance computing. I've not missed sum types at all. Most of what was added is something I see a lot of value in. I don't like that it, by design, obsoletes some older parts of the language, but that's about it.

I'm now using C# on linux almost exclusively. No complaints from me!


It's anything but a small language, but I wouldn't consider the stuff they're adding crap. They're useful features, but yes, this does have a price and makes the language larger.

There is value in a language with minimal syntax like Go, but it's not the only choice. C# is a pretty nice language overall, even with all the warts. But every language people actually use does have ugly stuff somewhere.


If you're creative about it you can make an interface for what is essentially a sum type.

All it takes is a method signature like:

   Z read<Z>(Func<A,Z> readA, Func<B,Z> readB)
It's a bit of a Yoneda embedding like way of forcing it in to the language, but hey it works.


I think I'm missing something.

Presumably, you use a function like this to represent your sum type containing the value "avalue":

    (readA, readB) => readA(avalue)
The problem I have is that when you create this function you have to reify the return type Z. You can't use this value in arbitrary contexts where the accessors need to return different types.

How do you get this to work?


You want to return different types depending on the branch?

I mean you could return a sum type if you really need to.

Formally a sum type is just something that turns a pair of functions to Z into a single function from the sum type to Z. In fact it shouldn't do more than that.


No, in any particular use of the value both branches return the same type Z.

But when I want to use the value in two different places I don't want Z to be the same in both places.

That's where I'm stuck. When I instantiate the function that represents a value of the sum type I need to choose a return type Z, which is locked in for every use of the value.

I think I understand the idea. I don't see how to make it work in C#.


Yep, this is exactly the approach we take. It works ok-ish, but it’s far from elegant. In our case ‘read’ is ‘Switch’. I think it’s a fairly common pattern in C# these days.


You can emulate sum types with classes and inheritance (N classes inherit from an empty base class), can't you?


It's very clunky


Yes, very clunky. One of the big issues with this approach is that switch expressions still require a default branch because there’s no way in C# to express a completely closed set. This makes future changes to the set (sum type) hazardous.

They continue to fiddle with design approaches to solve this. See https://github.com/dotnet/csharplang/blob/main/meetings/2025...


> Kodak aims to conjure up cash by ceasing payments for its retirement pension plan.

I assume this means payments to retirees. It's a good reminder that (if you can help it) you should not rely 100% on any external source (including the government) for your retirement income.


> I assume this means payments to retirees.

You assume wrong. From November 2024:

> According to the company, the plan’s liabilities to qualifying participants would be satisfied through a combination of lump sum distributions and an annuity purchased from an insurance company to cover existing obligations. Kodak, like many corporate pension plans, is in a funding surplus; it has significantly more assets than liabilities owed to plan beneficiaries and participants.

* https://www.ai-cio.com/news/kodak-considers-terminating-over...

> Kodak retirees would receive an annuity from an insurance company. Current employees, as well as former employees who haven’t yet reached retirement, would be given an option to either receive a lump sum of their balance, or an annuity once they retire. Plan participants wouldn’t see a change in the value of the benefits that have been promised to them, executives said.

> Kodak expects to put a new retirement plan in place for current employees if it terminates the pension. The company hasn’t yet determined whether it would provide a defined-benefit or defined-contribution plan, such as a 401(k). The company would need to have a new plan designed and in place within about a year, executives said.

* https://www.wsj.com/articles/kodak-prepares-to-terminate-u-s...

The money in the pension fund, at least up to an amount needed to satisfy current liabilities, is the property of employees and Kodak has no right to it. It is the surplus that was taken back by Kodak last year, and future payments are the ones that are ceasing. Per WSJ above another retirement plan system will be setup for current employees.


Ah - that's good to hear. Thanks for the extra information.


This will make you feel better: https://news.ycombinator.com/item?id=44050152


Exactly. See also recent SalesForce comments along these lines.


Happy new year from the US South y’all.


Python Atlanta organizer here. Come hang out sometime if you’re close!

Happy new year!


Happy New Year from Acworth!

Hope this is a great year for everyone!


Hey from there too. HMU!

pryelluw at gmail


Email sent!


I wonder if this is related to the NHC outage?

https://news.ycombinator.com/item?id=41771629


The National Hurricane Center website has been returning "503 Service Temporarily Unavailable" for a while now.


Seems to be back up now.


Is that unusual? Nothing in the article compares it to other fires. Honestly curious.

Also, this was a little ironic…

> The Tesla truck, driven by an employee, was headed to the company’s battery factory in Sparks, Nevada


ICE vehicle fires take about 1000 gallons, and the average fire hydrant puts out about 500-1000 gallons per minute. Structural fire engines carry about 1000 gallons and the heavy duty nozzles and ground monitors/deck guns put out 500-1000gpm. This is a LOT of water for a vehicle.


More like 300-400 gallons for your average urban engine. That's enough (with not much to spare) to knock down your average ICE car fire, but it's really there to allow the crew to get to work while they ship a hydrant.


I had the same thought, how many gallons is a diesel semi truck fire?

The part that concerns me is once electric cars are more ubiquitous, say 50% of cars on the road. How will we handle a pileup, where there could be five cars that all need the same level of fire department effort? Could there be some domino effect?


> and required aircraft to dump fire retardant overhead

I don’t think that’s standard vehicle fire practice.


I read the fire sheets for other tesla cars and they say 8k gallons to suppress a battery fire. However, the Semi's sheet does not give a qty estimate.

https://www.tesla.com/firstresponders


Well, I guess for gas-powered car 500 gallons would be sufficient, so 2 orders of magnitude less water.

EDIT: 500 gallons was originally just a wild guess, but here's an article where some firefighter gives 500-1000 gallons range: https://www.independent.co.uk/climate-change/tesla-crash-dri...


Sparks


That's low for an electric vehicle fire. An average car takes 500-1000 gallons. Teslas can take up to 30000-40000 gallons. Fwiw, most fire trucks only carry up to like 3000 gallons.


Most "Fire trucks" - I'm assuming you mean Engines - carry 500-1000 gallons, usually more on the 500 size. A "Water Tender" generally around 2000 gallons.


Engineer here.

> Fire trucks" - I'm assuming you mean Engines

No-no-no, an engine is a part that makes a fire truck move. Fire trucks usually have a diesel engine.

tips fedora


Software engineer, or IFSAC Apparatus Operator engineer? On the west coast we absolutely refer to our pumping apparatuses as fire engines; when Engine 813 is dispatched from our station to a call we bring the whole vehicle and not just the engine block!


Same in my department.

(The generic term for some type of fire-fighting vehicle is Apparatus.)


> Software engineer, or IFSAC Apparatus Operator engineer?

Yes, correct, engineer.


I eagerly await the release on Apple Books.


C# has default interface implementations now, that can be used to create mixins...

https://learn.microsoft.com/en-us/dotnet/csharp/advanced-top...


Yeah I sometimes use them but they don’t cover all the cases. I’m waiting for roles/extensions to see if I can achieve a similar result.

https://github.com/dotnet/csharplang/discussions/5496


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

Search: