r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

1

u/oneUnit Feb 22 '15

What about c#?

11

u/FireCrack Feb 22 '15

I feel like C# kind of inverts the problems of java. On the one hand it's got a way more usable standard library, on the other hand it's VM has until recently paled in comparison to the JVM, and still has compatability/portability issues.

5

u/f1zzz Feb 22 '15

Compatibility issues?

10

u/[deleted] Feb 22 '15

I assume he means the official VM is windows only

0

u/BOOM_BOOM_BADABOOM Feb 22 '15

.NET CLR is open source and apparently passing build on linux. How well it works, I have no idea.

4

u/[deleted] Feb 22 '15

Very true, I forgot about that. That's only a new development though

→ More replies (2)

23

u/btchombre Feb 22 '15

C# is awesome.. So long as you are only dealing with windows machines. Hopefully open sourcing the .NET core will make that better in the future

→ More replies (14)

5

u/[deleted] Feb 22 '15

What about it? Seems like a nice language.

1

u/oneUnit Feb 22 '15

I've heard that it's a much better "version" of java. I was wondering if /u/karlhungus has experience with c#.

12

u/[deleted] Feb 22 '15

Ah it wasn't clear from your comment.

To me, C# seems like a nice and simple language. Like Java, its optimal use story involves the use of an IDE. I would really like to try it out but unfortunately, the best C# IDE (Visual Studio) is Windows-only, while the best Java IDE (IntelliJ IDEA) is available on all major platforms.

3

u/giuseppemag Feb 22 '15

Xamarin studio works fairly well in Linux and Mac.

9

u/UglyBitchHighAsFuck Feb 22 '15

But still sucks compared to Visual Studio.

→ More replies (6)
→ More replies (11)

0

u/[deleted] Feb 22 '15

[deleted]

0

u/[deleted] Feb 22 '15

[deleted]

8

u/aradil Feb 22 '15

The power of free.

1

u/frugalmail Feb 23 '15

In the case of Java, the differences between it and C# are mostly trivial when it comes to the language itself.

The differences around the quality of OSS available for each platform and the Linux server side performance are major factors.

3

u/[deleted] Feb 22 '15

Java has way better standard library support for concurrency though. From what I can tell, C# lacks an equivalent for ConcurrentLinkedQueue and ConcurrentSkipListMap. Also no ForkJoinPool or Phaser.

3

u/Eirenarch Feb 22 '15

How is a ForkJoinPool different from a TaskScheduler - https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler(v=vs.110).aspx

Also why do you care if your ConcurrentQueue is a linked list or not? .NET's ConcurrentQueue seems to be a linked list of small arrays but this is an implementation detail that I do not expect anyone to care about.

3

u/[deleted] Feb 22 '15

The ForkJoinPool uses a pretty great scheduling algorithm, which allows for better cache locality and better handling of blocking IO.

The ConcurrentLinkedQueue implementation is wait-free, which is very important in soft real-time applications. The ConcurrentSkipListMap implementation allows truly concurrent reading and writing, using compare-and-swap.

In comparison, all concurrent collections in C# seem to use locks. Most applications don't need the distinction, but some (e.g. finance, game servers, ...) do need them.

1

u/Gurkenmaster Feb 22 '15

It's not a proper queue in my eyes if it uses locks. It's a toy.

1

u/Eirenarch Feb 22 '15

The ForkJoinPool uses a pretty great scheduling algorithm, which allows for better cache locality and better handling of blocking IO.

So does the Task Scheduler (it does work stealing). As far as I know they are pretty similar.

ConcurrentQueue in .NET is also lock free and it is essentially a linked list. If anything it looks more advanced since it uses Segments instead of items which may help with cache locality. In any case I don't think they did the additional work to introduce segments if it didn't improve performance over pure linked list.

1

u/[deleted] Feb 22 '15

Those 2 data structures don't exist in the .Net framework, indeed.

Regarding parallelism in general, the TPL (and async/await from C# 5) address all parallel/asynchronous needs.

And with support for delegates as first-class values you write much less code.

1

u/bobbybottombracket Feb 23 '15

Except the fact that C# is 10 years older.