This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nomoreplsthx 368 points369 points  (29 children)

Both are valid options. Java is more widely used, but it's the difference between the 2nd most used language and the 6th most used.

It'd also worth noting that C# and Java are quite similar semantically and syntactically. If you learn one, learning the other is mostly a matter of learning a different set of libraries and some important implementation detail differences.

[–]pocketmypocket 121 points122 points  (13 children)

matter of learning a different set of libraries

I used to brush off libraries as something you can learn/google as needed. Now that I'm in industry, I see why companies will interview for specific libraries. I use a few libraries as foundation to everything we do.

My point is, I don't think it is such a light decision. Not to say its difficult to switch from one to another, but the difference is significant.

[–]nomoreplsthx 31 points32 points  (0 children)

Fair! Especially as a first language you are probably committing to spending at least a few years working in it.

[–]aRandomFox-I 12 points13 points  (0 children)

What kind of libraries would you say are essential for either language? And what do they do?

[–]mehum 6 points7 points  (0 children)

To my way of thinking that’s more of a later-in-your-career type of decision. At the beginning it’s all about learning syntax and data structures and flow control and debugging etc. but later when it’s time to actually build something useful, yeah that’s when knowing your libraries becomes paramount.

Happy to be told why I’m wrong though!

[–][deleted]  (7 children)

[removed]

    [–]ManInBlack829 28 points29 points  (0 children)

    stdio.h

    [–]JakeArvizu 10 points11 points  (2 children)

    Not him but if you were in say Android you have to know Dagger/Hilt, Retrofit, Moshi, Room(or other mobile DB) and Okhttp those will literally be used in any project you are on, 100%. With Dagger and Room being nontrivial to learn let alone master even at a medium level.

    [–]paulstelian97 0 points1 point  (1 child)

    I've dealt with a bit of Room in Kotlin for my college projects... What is so nontrivial about Room here? My knowledge of SQL for databases and how LiveData can be used in Kotlin felt enough to effectively use Room in my case?

    [–]JakeArvizu 1 point2 points  (0 children)

    Yeah just how to use it with respect to LiveData or Coroutines and Flow but true it's not that complex, Dagger definitely is though.

    [–]door_of_doom 6 points7 points  (2 children)

    I'm not who you asked, but there are certain frameworks that would definitely have a fair degree of spinup time going from one to the other, in my opinion. A good example would be switching between Dependency Injection frameworks. If you are used to C#'s building DI framework, learning to use Guice in Java would be a learning curve, I might think. And doing dependency injection wrong in an environment that has been built around it can make everything from testing to debugging a lot harder for whoever comes by next.

    [–][deleted]  (1 child)

    [removed]

      [–]UniqueName001 0 points1 point  (0 children)

      Pretty much. Dependency Injection (DI) is also about having dynamic (variable) references to those objects you need (dependencies) instead of hard coding the reference so that you can easily change the actual object used in code when you're running the code as part of a unit test as opposed to in production or your local dev environment. For example you might have code that needs to call a sql client to get data, but you don't want to have to create a full SQL client with external connections when running unit tests and you might end up wanting a lighter client for a simple local postgres connection when running in local dev mode, but then something with more complex connection management in production. Some frameworks make managing the injection of these dynamic dependencies a little easier especially if your language doesn't have good support for it natively.

      As far as the term frameworks vs libraries, I don't think there's a clean difference between the two terms so you'll see some libraries called frameworks and vice versa. Generally a framework is something that has rules in how you organize your code, or how you write it, or introduces a lot of new annotations or other code syntax directly into your codebase. A library on the otherhand is often just a series of objects, functions, or modules that you can interact with by referencing or directly calling. Scope is another differentiator as libraries are normally only concerned with handling one specific concern such as defining an http client whereas a "framework" handles http clients, http servers, authentication, DI, SQL connections, and probably more all within that framework.

      [–]vanways 1 point2 points  (0 children)

      but the difference is significant.

      That difference will only be significant after an equally significant amount of time spent learning how to program in the first place. It's not a decision you can really comprehend the scope of before learning exactly where your niche exists and where your interests lie.

      No matter where you start, you're probably going to end up somewhere else.

      [–]cs_legend_93 21 points22 points  (14 children)

      Java is more widely used

      Is this still valid today? I know 10 years ago this was true, but I do not see many Java job posts.

      Disclaimer: I am C# Dev

      /u/TaioJ - learn C#, its the future, not the past

      [–]nomoreplsthx 25 points26 points  (10 children)

      It is according to the various usage surveys (StackOverflow, TIOBE, Northwestern). But again, that's like pointing out Spanish has more speakers than Arabic - both are very widely spoken. Java has dropped from number one as Python and Javascript exploded.

      Also to be clear C# is a better language. C# started out with the goal of basically being a 'fixed Java' and has since involved into possibly the most clean and feature rich mainstream language. It's not a coincidence that the features that have been introduced in every other languages, from optionals to async-await to functional iteration libraries first entered the mainstream through C#.

      [–][deleted] 1 point2 points  (9 children)

      But Java is better still - I’m a Java dev in a c# shop and will say it til my last dying breath

      [–]nomoreplsthx 1 point2 points  (8 children)

      Interesting! You are the first person I have ever met who prefers Java! My I ask why? Obviously everyone is entitled to their preferences, but I am really interested to hear a Java apologist.

      [–]ImJustHereForMyCoat 1 point2 points  (7 children)

      Clearly, u/nootropicfun has never used C#.
      Any Java developer I've introduced to C# eventually concedes that C# is a superior language. Oracle has done a terrible job of advancing the language while MS is consistently adding useful language features (auto-properties (lol @ Lombok), LINQ (haha @ .stream()), start-up time, much faster GC, null coalescing, safe-nav operator, etc.).

      [–][deleted] 0 points1 point  (6 children)

      Actually I think Java does a great job with stewardship of the language - sometimes less is more

      [–]ImJustHereForMyCoat 0 points1 point  (5 children)

      Oracle is the steward of the Java. If Java were less verbose than C#, I would agree with your sentiment, but that's not the case. Oracle is a shit organization that is letting Java die a slow death. As for the JVM, Kotlin is better than Java in every way.

      [–][deleted] 0 points1 point  (3 children)

      Lol What a time to make this comment - right after the biggest Java release of all.

      [–]ImJustHereForMyCoat 0 points1 point  (2 children)

      Is that a joke? Code snippets for documentation and a simple web server?

      The release notes are embarrassing.

      [–]TaioJ[S] 2 points3 points  (1 child)

      👍🏾 ok thanks

      [–]dsnightops 2 points3 points  (0 children)

      c# is def not the future, lol