Most active commenters
  • breadwinner(10)
  • neonsunset(4)
  • int_19h(4)
  • kllrnohj(3)

←back to thread

253 points chhum | 58 comments | | HN request time: 2.404s | source | bottom
Show context
nelup20 ◴[] No.44009800[source]
I personally appreciate Java (and the JVM) much more after having tried other languages/ecosystems that people kept saying were so much better than Java. Instead, I just felt like it was a "the grass is greener" every time. The only other language that I felt was an actual massive improvement is Rust (which so far has been a joy to work with).

It's a shame imo that it's not seen as a "cool" option for startups, because at this point, the productivity gap compared to other languages is small, if nonexistent.

replies(6): >>44009912 #>>44009928 #>>44009952 #>>44010109 #>>44010282 #>>44010468 #
1. kllrnohj ◴[] No.44010282[source]
Personally I think C# is miles ahead of Java and in meaningful ways (like a drastically better implementation of generics, not to mention value types have existed for eons at this point and an FFI system that doesn't hate you for using it)

But nobody seems to talk about or care about C# except for Unity. Microsoft really missed the boat on getting mindshare for it back in the day.

replies(12): >>44010302 #>>44010329 #>>44010450 #>>44010481 #>>44010493 #>>44010636 #>>44010692 #>>44010825 #>>44010902 #>>44011079 #>>44011124 #>>44012556 #
2. echelon ◴[] No.44010302[source]
That's because the Microsoft of 2000 - 2014, the Ballmer era, was Microsoft-first. It didn't care about other platforms, it didn't care about the web, and it didn't care about open source. C# could be great, but it existed in a bubble.

Java kept growing and wound up everywhere. It played nice with Linux. Enterprise Mac developers didn't have trouble writing it with IntelliJ. It spread faster because it was open.

Satya Nadella fixed a lot of Microsoft's ills, but it was too late for C# to rise to prominence. It's now the Github / TypeScript / AI era, and Satya is killing it.

The one good thing to say about Ballmer is that he kicked off Azure. Microsoft grew from strength to strength after that.

replies(2): >>44010348 #>>44011550 #
3. jayd16 ◴[] No.44010329[source]
Its actually quietly very popular in very boring contexts outside of Silicon Valley. Its also slowly entering new areas now that Linux builds are rock solid.

MS does have an uphill PR battle though.

4. ◴[] No.44010348[source]
5. bsaul ◴[] No.44010450[source]
Problem with C# isn't the language, it's the enterprise ecosystem. You always feel like you're going to have to pay at some point down the road for using the tech.
replies(2): >>44010574 #>>44010608 #
6. watwut ◴[] No.44010481[source]
Definitely not. All the stuff I was used to get for free and advice I that was one google search away ... just dont exist in dotnet. Or is expensive. But most of the time, there is weaker library not doing nearly enough and that is all that exists.
7. dagw ◴[] No.44010493[source]
nobody seems to talk about or care about C# except for Unity

C# is extremely popular in all kinds of 'boring' industries. Having worked in areas like logistics and civil engineering, C# is everywhere.

8. cgh ◴[] No.44010574[source]
Every large company I’ve ever worked at had a strict “no Microsoft on the server” policy and for better or worse, C# is closely identified with Microsoft.
replies(1): >>44011041 #
9. hu3 ◴[] No.44010608[source]
I don't see Java being any better in this regard.

Microsoft has been historically much less aggressive with lawyers compared to Oracle.

replies(4): >>44010740 #>>44010762 #>>44011086 #>>44011178 #
10. nextos ◴[] No.44010636[source]
C# had the chance to learn from Java. Java was a bit rushed. Gosling said he was not given enough time to add closures. Even without generics, Java would have been quite elegant and much less verbose. The alternative, anonymous inner classes, were quite clunky.

Nevertheless, as a platform, the JVM and JDK were fantastic and miles ahead most alternatives during the late 1990s and 2000s. The only platform for large development that offered some compelling advantages was Erlang, with BEAM and OTP.

replies(1): >>44010753 #
11. breadwinner ◴[] No.44010692[source]
One area where C# really messed up is exception handling.

See https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

replies(4): >>44010987 #>>44011072 #>>44011368 #>>44011745 #
12. frontfor ◴[] No.44010740{3}[source]
That might be true for other Oracle products like the DB, but has that been true for Java and openjdk?
replies(1): >>44013068 #
13. hocuspocus ◴[] No.44010753[source]
Java could have easily caught up with C# in the early 2000s. In 2001 Pizza (Scala's ancestor) showcased generics, higher-order functions, ADTs and pattern matching. Interestingly enough only generics made it to Java in a reasonable timeframe, the rest came only much later.

Aside from early versions being rushed, I feel that Java's success and adoption were the bigger issue. While Microsoft could iterate quickly and break backwards compatibility with major versions of C# and the .NET runtime, Java was deliberately moving at a much slower pace.

replies(1): >>44020224 #
14. wslh ◴[] No.44010762{3}[source]
I think OP means that .NET has strong connections with Microsoft technologies where it is a natural decision to use Azure instead of AWS.
15. wokkel ◴[] No.44010825[source]
It barely works on non MS platforms,has had many slightly incompatible versions so it's a non starter for many projects where I run into that might benefit from c#. I spoke to a manager recently who had invested in silverlight in the past. Based on that alone it was a no MS policy for his development teams.
replies(4): >>44011050 #>>44011156 #>>44015516 #>>44122725 #
16. astura ◴[] No.44010902[source]
C# isn't popular in startups for the same reason Java isn't, it's "boring."

It's an extremely common language in "boring" companies doing "boring" (but profitable) work.

17. easton ◴[] No.44010987[source]
They intentionally chose to not have checked exceptions though, and people have different opinions on it. They believed that people would just catch Exception most of the time anyway instead of selecting on a very specific type (which is often how it works, in web apps anyway.)

https://www.artima.com/articles/the-trouble-with-checked-exc...

replies(1): >>44011111 #
18. runjake ◴[] No.44011041{3}[source]
IOW Linux on the server?
19. runjake ◴[] No.44011050[source]
AFIACT, either most or at least a significant percentage of dotnet code runs on Linux, depending on the industry.
20. neonsunset ◴[] No.44011072[source]
IIRC all previous conversations about checked exceptions here ended up with the swift conclusion that they are heavily discouraged throughout Java code.
replies(1): >>44011113 #
21. astrange ◴[] No.44011079[source]
> But nobody seems to talk about or care about C# except for Unity. Microsoft really missed the boat on getting mindshare for it back in the day.

There was this guy Miguel de Icaza. From when I followed the open source ecosystem at the time, it seemed to be his personal mission to promote independent clones of a bunch of Microsoft technologies like C# on his own time even though they didn't ask him to do it.

I don't think I ever understood why someone would do this. It's like in the 2000s where people seemed to think you could solve all technical problems by inventing new kinds of XML.

replies(1): >>44013990 #
22. antod ◴[] No.44011086{3}[source]
The poster was talking about the ecosystem not the core platform. The wider Java ecosystem was heavily dominated by many Apache (and other) open source libraries vs commercial products for the C# ecosystem.
replies(1): >>44011133 #
23. breadwinner ◴[] No.44011111{3}[source]
> They believed that people would just catch Exception most of the time anyway

Their belief was wrong. Microsoft now recommends against catching Exception.

The article you linked to is addressed at the bottom of this article: https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

24. breadwinner ◴[] No.44011113{3}[source]
> they are heavily discouraged throughout Java code

That's so ignorant. Read the article please.

replies(1): >>44011181 #
25. neonsunset ◴[] No.44011133{4}[source]
Most of the features that require Apache or community packages in Java ship out of box in .NET (or via extension packages).

They also tend to be of higher quality and provide better performance.

26. neonsunset ◴[] No.44011156[source]
Quite a few languages "loved" by "Linux communities" tend to have rather rudimentary integration with Linux kernel's facilities or worse packaging story.

For example, Go does not understand cgroups limits and needs an external package to solve this. .NET can read and accommodate those natively. It also ships with excellent epoll-based socket engine implementation. It's on par with Go (although I'm not sure which one is better, but .NET performs really well on high-throughput workloads).

27. cyberax ◴[] No.44011178{3}[source]
Java has a strong history of OpenSource, and a great set of libraries. It also pioneered the managed dependency system early (Maven), so these libraries have been centrally available for two decades.

Moreover, a lot of these libraries are well-supported to this day. For example, Hibernate (the best ORM in business) is 28 years old, and has just released a new version. I recently consulted my former client (from 15 years ago), and I still recognized most parts of the stack that I set up way back then.

28. neonsunset ◴[] No.44011181{4}[source]
Let's revisit past conversations:

- https://news.ycombinator.com/item?id=43226624

- https://news.ycombinator.com/item?id=43584056

- https://news.ycombinator.com/item?id=36736326

And more. I'm not sure what you found in (checked) exceptions. If you'd like explicit error handling, we have holy grail in the form of Rust which beautifully solves it with implicit returns, error type conversions and disambiguation between error and panic model. I'd prefer to use that one as it actually reduces boilerplate and improves correctness, the opposite to the outcome of using checked exceptions.

replies(2): >>44011309 #>>44011760 #
29. breadwinner ◴[] No.44011309{5}[source]
> I'm not sure what you found in (checked) exceptions.

I could copy/paste the entire article here... but it would be easier if you could take a gander: https://mckoder.medium.com/the-achilles-heel-of-c-why-its-ex...

Summary:

Crashy code: You have no compiler-enforced way to know what exceptions might be thrown from a method or library.

More crashy code: If a method starts throwing a new exception, you might not realize you need to update your error handling.

Dead code: If a method stops throwing an exception, old catch blocks may linger, becoming dead code.

replies(2): >>44012858 #>>44013364 #
30. jayd16 ◴[] No.44011368[source]
Java streams and a lot of other APIs are extremely ugly because of checked exceptions. Conversely, LINQ and delegates and a lot of other syntax is far cleaner in C#.

Your linked blog is pretty wild. Only throw RuntimeExceptions to crash? Why not just Exit if that's the proper thing to do?

If you treat all C# exceptions as RuntimeExceptions, then it satisfies the blog anyhow.

replies(3): >>44011399 #>>44011441 #>>44015573 #
31. breadwinner ◴[] No.44011399{3}[source]
> Why not just Exit if that's the proper thing to do?

Because you won't get a stack trace.

32. vips7L ◴[] No.44011441{3}[source]
Checked exceptions could still work across lambdas. Scala is doing research there: https://docs.scala-lang.org/scala3/reference/experimental/ca...
replies(1): >>44020234 #
33. fuzztester ◴[] No.44011550[source]
>Satya Nadella fixed a lot of Microsoft's ills,

which ones?

replies(1): >>44011676 #
34. echelon ◴[] No.44011676{3}[source]
So many.

Microsoft isn't thought of as evil anymore, but is open source and Linux friendly. GitHub, VScode, Typescript. Azure is booming, ...

But the big one: stock price.

replies(2): >>44014257 #>>44020211 #
35. bigstrat2003 ◴[] No.44011745[source]
I don't know that I'd say "messed up", but I do wish C# had checked exceptions. I strongly believe that they are superior to non-checked exceptions, basically static type signatures but for error handling. It's a real pity that everything after Java seems to have abandoned the idea.
replies(1): >>44014344 #
36. bigstrat2003 ◴[] No.44011760{5}[source]
> I'd prefer to use that one as it actually reduces boilerplate and improves correctness, the opposite to the outcome of using checked exceptions.

Reducing boilerplate is not a valuable goal in and of itself. The question is, does the boilerplate buy you something? I think that with checked exceptions it does. Having an explicit type signature for what errors a function can raise improves correctness a great deal because the compiler can enforce the contracts of those functions.

I agree that the Rust approach is good too, though I don't agree it has any strong advantages over the way Java does things. Both approaches are equally respectable in my view.

37. throw1235435 ◴[] No.44012556[source]
Depends where you work. I've seen a lot of Java and .NET jobs around where I am. Having both jobs I find it easier to get performant code in .NET than Java (reified generics, value types, more primitives/less boxing in general, and other constructs not found in Java)
38. Kwpolska ◴[] No.44012858{6}[source]
None of those arguments are convincing. In many cases, you can't handle errors more reasonably than just crashing or telling the user something went wrong. Java has RuntimeExceptions, which do not have to be declared in the function signature. Division by zero, or trying to index an array out of bounds, and the dreaded NullPointerException, are some examples of RuntimeExceptions.
replies(1): >>44014105 #
39. homebrewer ◴[] No.44013068{4}[source]
Sure. Here's just one example I was able to quickly find in the browser history:

https://www.theregister.com/2025/05/09/users_advised_to_revi...

You can easily just not use the Oracle JDK, though, unless you're running commercial software which requires running on the Oracle runtime to get technical support.

As others have said, the problem is not the runtime, but libraries: many major .NET libraries have been going fully commercial, you can't really trust the ecosystem anymore.

40. mrkeen ◴[] No.44013364{6}[source]
> You have no compiler-enforced way to know what exceptions might be thrown from a method or library.

Always assume exceptions will be thrown from a method or library.

replies(1): >>44014097 #
41. bitwize ◴[] No.44013990[source]
The founding document of GNOME was written by de Icaza. It was called "Let's Make Unix Not Suck", and his proposal for not sucking was basically to import much of the design of Windows and specifically COM into Linux as open source.

https://web.archive.org/web/20000815075927/http://www.helixc...

Miguel de Icaza has been stanning for Microsoft technologies, literally since the nineties.

42. breadwinner ◴[] No.44014097{7}[source]
Which ones? That's the issue.
43. breadwinner ◴[] No.44014105{7}[source]
What about the ones you can recover from? You don't want to crash the entire application every time there's an exception!
replies(1): >>44015271 #
44. Squeeeez ◴[] No.44014257{4}[source]
> Microsoft isn't thought of as evil anymore

Maybe you don't think of it like that, but please remember that, especially with some decisions made in the past months, more and more people are turning away from everything Microsoft.

45. kllrnohj ◴[] No.44014344{3}[source]
Java itself has basically abandoned the idea, or at least the ecosystem at large has. Checked exceptions are a decent idea but Java's implementation sucks. It needs to be a lot more automatic or something
replies(1): >>44015507 #
46. Kwpolska ◴[] No.44015271{8}[source]
You usually wouldn’t crash the entire application, the request that causes the issue will return a 500 error. (Or equivalents for non-web environments.)
replies(1): >>44016587 #
47. breadwinner ◴[] No.44015507{4}[source]
> Java itself has basically abandoned the idea

Some Java developers may have, due mostly to misinformation from the .NET camp.

48. tester756 ◴[] No.44015516[source]
>It barely works on non MS platforms

What a bullshit

I've been running C# on Linux on production web apps backends since 2018 and had no issues

49. breadwinner ◴[] No.44015573{3}[source]
Side effects are not allowed in functional style programming. Exceptions are side effects, it doesn't matter whether they are checked or unchecked exceptions.

https://jessewarden.com/2021/07/why-functional-programmers-a...

While composing methods in stream style is convenient, methods that can throw exceptions warrant more careful coding, so convenience should not always be the priority.

replies(1): >>44020229 #
50. breadwinner ◴[] No.44016587{9}[source]
Some exceptions are not recoverable and may cause 500 error. Others such as FileNotFound are recoverable, for example by reading the file from an alternate location.
51. int_19h ◴[] No.44020211{4}[source]
Funny you should mention open source and VSCode.

VSCode itself, for all the promotional materials about how it's open source, is officially "a distribution of the Code - OSS repository with Microsoft-specific customizations released under a traditional Microsoft product license".

But wait, you might say, it's just like Chrome vs Chromium - so long as we have the OSS edition, it's all good! But, unless you're writing JS or TS, you need extensions to do anything useful. Python is an extension. So is C#, and C++. And all of these are partially closed source - e.g. code completion for all three, or debugging for both C# and C++.

Worse yet, the licenses for those closed source parts specifically prohibit their installation and use in anything other than the official closed source VSCode distro. And this isn't just verbiage - there are actual runtime checks in all these products that block attempts to use them in VSCodium, Cursor etc.

The same goes for the official VSCode extension gallery / marketplace - you can't legally use it from anything other than the official VSCode. Enforcing that is trickier, but even here Microsoft managed to find a way to frustrate its users: it used to be possible to download a .vsix from the Marketplace, but that feature has been removed recently, precisely because people were using that in conjunction with Cursor etc.

Much open source, indeed.

52. int_19h ◴[] No.44020224{3}[source]
In fact, Java 1.5 got generics in 2004, one year before C# 2.0 added them in 2005. OTOH C# 2.0 had anonymous delegates, although syntactically they were still very verbose (no type inference for arguments) and thus only marginally better than Java's anonymous classes.

It was really from 2007 on (.NET 3.5 / C# 3.0) that C# started to get major features at an ever increasing pace while Java significantly stagnated for quite a long time.

replies(2): >>44022410 #>>44096834 #
53. int_19h ◴[] No.44020229{4}[source]
Exceptions are not side effects since no state mutation occurs.

If you really want to see everything through the FP lens, exceptions are exactly like Result<T, E> with implicit do-notation.

54. int_19h ◴[] No.44020234{4}[source]
One of the original lambda proposals for Java - the one from Neal Gafter - also had checked exceptions.

The problem is that you then need a way to capture exception specifications as generic type parameters to properly propagate contracts, which complicates the type system quite a bit. Which is why Java ultimately went with the much simpler proposal that didn't even try to tackle this.

replies(1): >>44043517 #
55. hocuspocus ◴[] No.44022410{4}[source]
Thanks, my recollection of C# evolution was blurry, I stand corrected.

So really, Sun and Oracle could have definitely moved faster around Java 6 and 7, the Java 8 release took a long time given the feature set.

I feel that records could have come quicker, their implementation isn't exactly ground breaking. Avoiding the async/await route was a smart call though, and Loom could probably not have happened much earlier.

Valhalla is another can of worms entirely

56. vips7L ◴[] No.44043517{5}[source]
Yes I'm well aware, but that is uniquely a Java problem. With a sufficiently strong type system, like the one in Scala, you can easily make checked exceptions work across higher order functions.
57. kllrnohj ◴[] No.44096834{4}[source]
C#'s runtime got generics in 2005 whereas Java still just has compiler-only sugar. It's a rather significant difference in the quality of the implementation. Not just for things like reflection but also means List<T> ToArray actually can return T[] instead of Object[].

It also means the .NET ecosystem didn't need the inline+reified kludge that Kotlin came up with https://kotlinlang.org/docs/inline-functions.html#reified-ty...

58. blandflakes ◴[] No.44122725[source]
We've been running .NET on linux for years, what are you talking about?