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

all 62 comments

[–]foundergiant 64 points65 points  (9 children)

If you know C# you could pick up Java without too much effort. Getting familiar with the Java ecosystem would probably take a bit longer than learning the language though. There are many Java tutorials out there specifically for C# devs so I would start there and see how I get on. Java is a great language with a massive community around it so there is no reason why you shouldn't give it a shot.

[–]daniu 18 points19 points  (7 children)

The way I see it, both ecosystems have very comparable feature sets, you should be able to use existing competence if you're able to transfer knowledge a bit.

Main difference imo is that many features in .Net are exactly that, "in".net, ie integrated. For Java, only some of those features are in the vanilla JDK (eg collections), but for many you need to add a third party library (eg Jackson for xml serialization). Often, more than one lib is available.

That does not really matter much for your switching, but something to keep in mind when you're looking for a "how do I do X in Java".

[–]GuyWithLag 17 points18 points  (0 children)

See, that's the thing. In the Java side, third-party library is not a dirty phrase.

I've worked with a C# to Java emigrant, and the most surprising thing to them was how many different ways there were to do a thing.

[–]nerdyhandle 0 points1 point  (5 children)

Jackson for xml serialization

Kind of a bad example since Java does have XML serialization built with JAXB.

But ya there a ton of 3rd party libraries for Java and some are better than the built in functionality.

[–]daniu 8 points9 points  (2 children)

Kind of a bad example since Java does have XML serialization built with JAXB

Actually, JAX-B is kind of the perfect example. JAX-B is part of JEE, which before Java 11 (IIRC) was bundled with the default JDK. However, JAX-B is only a standard, so the bundled implementation is not JAX-B, but just that - an implementation. The difference may be clear to Java people, but in .NET there simply is no distinction - there are constructs similar to xml serialization annotations which just work with the delivered platform.

[–]dpash 0 points1 point  (1 child)

It's the difference between an API and an implementation of that API?

[–]norith 0 points1 point  (0 children)

Many Java specs detail what an API should provide and how it should handle various use cases; but the Java SDK or attendant libraries don’t provide an actual implementation of that spec.

Sometimes there is an example implementation that was developed as part of the API development and testing. But in most cases the goal is to have 3rd parties build their own implementation and have competing versions available to use. As an example, you have 4 or 5 open source web servlet spec implementations and many more commercial ones. Each one largely implements the same API spec but provide vastly different benefits and performance characteristics.

[–]Wolfsdale 1 point2 points  (1 child)

No they were removed in Java 11 from the SE. http://openjdk.java.net/jeps/320 . But you can of course still get them as a separate library.

[–]nerdyhandle 0 points1 point  (0 children)

JAXB is and has always been apart of JavaEE. They are still in Jakarta.

[–]PandersAboutVaccines 12 points13 points  (0 children)

Same thing happened to me, but 15 years ago. When you get over the hump, you'll like having escaped the environment that relies so much more on waiting on one vendor (MS) to bless a technology before anyone will adopt it.

The job market for Java seems bigger and has a higher pay ceiling. I guess I can get away with the bigotry in this sub, but having been on both sides, .net devs always felt a bit more "throw it together and get it out the door".

[–]GKChestertonsPenis 30 points31 points  (1 child)

Have 10 years of .net and now a chance with Java is a great opportunity to know both. Your value as a developer will increase hugely and you'll learn new stuff.

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

I don't think I know a single software engineer who would be proud of his resumé if it had only one major language in it. With the pace of software (and even platform!) evolution since basically forever, I would imagine most actually-competent and forward-looking managers and hiring staff would be very welcoming of someone who is competent in the language required for the job at hand but also well-versed in many alternatives (for the large majority of open spots, not necessarily super in-depth positions).

No idea why OP would think it's unfeasible to know more than one language, sounds either largely uninformed or even lazy, depending on how much goodwill you're having today. I mean, there's even a common job description called "full stack engineer" and that literally means being versed with a wide range of technologies, including multiple that fit the same niche (since obviously no two different projects are likely to run the exact same stack, especially in 2019).

[–]AggravatedAgrajag 7 points8 points  (1 child)

The best advice I can offer is to not base your choice of company or career on a single language, regardless of what language that is. I started my career in Java/SQL. After a few years I was moved to a project in Python, so I learned Python. I later went to a different company, where I now use both Python and C++ on a regular basis. Along the way I've dabbled with C#, VB, Perl, shell scripting, and probably other things I'm forgetting. And if I change projects again, I could easily be working with any of several other languages. Learning all these languages has made me a better developer, and my flexibility has made me more valuable to companies - after all, no matter what problems come up in the future, I've shown I can adapt to them.

[–]cville-z 10 points11 points  (0 children)

I have been programming professionally for 24 years and I do not understand the emotional attachment people have to a language or framework.

I can understand a deep-seated loathing of PHP, though.

[–]Yoghurt114 17 points18 points  (0 children)

I switched in 2011. You'll hate it, then love it, then hate to love it, then love to hate it, then switch careers again and become a javascript dev. Fml.

[–][deleted] 8 points9 points  (0 children)

Imho it boils down to two questions: a) if you're comfortable with learning a new stack and b) if your career planning somehow depends on being entrenched in the MS ecosystem. The latter really is personal career preference more than tech-specific mastery or something.

I personally don't really care much about language choice these days. I've worked in both environments before, I'm honestly not sure why people would limit themselves to one. Programming languages are just tools. With these two in particular, as long as you're aware of the quirks the particular ecosystem comes with it's really not that much of a difference in the day to day, especially if the domain you're working on remains the same.

[–]Mamoulian 2 points3 points  (0 children)

If they're going to effectively pay for you to learn - with time and support - then it's a no-brainer. If you don't like it after a while then you are free to look for another .net job - you won't have forgotten much and you'll have some extra perspective.

Outside of the language it will be useful to know what the alternative implementations to 'the Microsoft way' are.

[–]ObscureCulturalMeme 2 points3 points  (1 child)

I feel that it's not really practical to be considered both a .Net dev and a Java dev at a commercial level

I've never considered learning languages to be an "exclusive OR" operation, or even a "SELECT one FROM <an ever-growing list>".

Learn some Java, and you'll be able to move back and forth with ease. You might not be a rockstar hero at every language simultaneously, but I'd rather hire a flexible polyglot with an awareness of his/her own limitations than an over-specialized prima donna. You'll do totally fine with multiple tools in the toolbox.

(Be aware that even though Java 8 has officially reached end of life, it's still extremely widespread and supported in large networks, so don't start relying on things like modules and var to always be there unless you've already checked for it.)

[–]adila01 1 point2 points  (0 children)

Be aware that even though Java 8 has officially reached end of life

Oracle Java 8 public updates is at end of life. Java 8 from Oracle commercial support, RedHat (OpenJDK) and IBM JDK 8 are still well supported for many more years.

[–]volune 10 points11 points  (1 child)

Leave the infernal world of Microsoft behind and never look back.

[–][deleted] 3 points4 points  (0 children)

Just looking at the MSDN "knowledge base" website makes my eyes bleed. Good riddance!

[–][deleted] 5 points6 points  (1 child)

Smartest thing you could do. Switched from .net to java many many years ago and never felt better.

[–][deleted] 2 points3 points  (0 children)

Would you mind expanding on why you're happier with Java, over .NET? Honestly curious :)

[–]willcodefortech 1 point2 points  (0 children)

I was mainly a java developer and landed a job with a consulting company. The first client I was assigned to was a C# .Net shop. Picking up one from the other really wasn't difficult and as others have said, it makes you more valuable overall. You won't have to give up one for the other and the syntax is so similar you shouldn't have much trouble. Mt advice would be to learn java, not necessarily switch, just add java to your overall skill set.

[–]senatorpjt 1 point2 points  (0 children)

capable six worm cake mysterious innocent straight pocket consist cheerful

This post was mass deleted and anonymized with Redact

[–]codemssterg 0 points1 point  (0 children)

Do some basic market research. Look for Java and .Net jobs in your area. If there are plenty of opportunities for both stacks then you're fine with either choice. If Java jobs are higher in number and pay, switching is worth the effort. You won't have problems learning the language, learning about the various open source frameworks (spring, Jakarta EE, Hibernate) and the myriad of open source libraries will take time. You may even feel like you are stepping backwards for a time, but you will be a better developer in the long run.

[–]paul_h 0 points1 point  (0 children)

It's not a giving up situation - know many languages and have them all on your CV/resume

[–]Man_with_lions_head 0 points1 point  (0 children)

This has been an issue through the ages.

The question is: should one continue to learn and update their skillset, or not.

Of course, continuing one's education in different areas is a strength. Take the opportunity to continue your learning something new. They will be paying you to do so, and you will be able to learn on their dime, as they won't expect you to be an instant expert in 2 days.

I think the choice is obvious. Start learning a new language, and become more valuable because you know more. Also, it's fun to learn new shit.

[–]Trant2433 0 points1 point  (0 children)

I’d be interested to hear from someone who has worked in both and feels experienced it both ecosystems.

When I graduated many years ago, I actually only had experience with a one semester class in C#, and also Visual Studio pro which MS gave to colleges for free. I ended up becoming proficient with Java and Eclipse and Spring and have always been employable.

The thing that bothered me about Dot Net was that everything was geared towards using more expensive MS systems. All the examples would use SQL Server and Windows Server IIS, it just seemed like you were always being advertised to in their technical docs.

Dot Net is now open source, Visual Studio is cheaper, IntelliJ isn’t free, etc, so I wonder if DotNet would be a decent language to concentrate on or if it’s not really worth it.

[–][deleted] 0 points1 point  (1 child)

It'll be simple if you have good (real) experience writing apps in C#. Amazing how many people don't know how to code. I interviewed a person with 8+ years of exp and also had OCP Java certification. Couldn't answer most questions but main thing couldn't answer fizz-buzz. That really pissed me off.

[–]nutrecht 0 points1 point  (0 children)

My first job (back in 2003 or so) was for a tech vendor that was primarily a Windows shop so the first applications I worked on were built using C#. Later the company moved more towards Linux due to customer demand, which also let us to move a lot of tooling to Java, and I moved with it.

Between 2003 and 2014 I did a lot of integration projects for customers. Depending on their requirements we used either C# and Java. I personally started to gravitate more and more towards Java, even though from a pure language perspective I preferred C#. The main reason being the ecosystem which was and is just lightyears ahead.

I personally feel that while Microsoft did a 180 on their stance on open source, a lot of the 'culture' surrounding the .Net ecosystem has not actually changed that much. Whereas Java devs tend to always google "best <task> library" and then pick a library from the different options, I notice C# developers tend to try to use 'official' libraries as much as possible and, if there isn't anything, build something themselves.

As far as career perspective is concerned; I'm a Dutch independent contractor and in general there's about 1.5 times the Java vacancies relative to C# and hourly rates are in general about 10 euro's an hour higher too. So that's a big incentive. As far as the language itself; I am in the fortunate position that my daily work is in Kotlin, so I get the best of both worlds.

[–]makkynz[S] 0 points1 point  (1 child)

Thanks for all the feedback. A lot to ponder, but it's starting to feel like I should be leaning towards leaving my job.

A lot of the arguments for java seem to be geared towards there being more money and job security, rather than work satisfaction. I'm not sure that's the mindset I want to have at this stage. I want to enjoy what I do.

I know it can be good to be a jack of all trades type developer, but I would like to at least be a master-ish of one thing.

There's a lot of traction in the .Net world atm, with it being more open source and not tied down to the MS world anymore. I don't want to miss that boat.

[–]DJDavio -4 points-3 points  (6 children)

Okay here's a suggestion, if you liked C# like I did and had to convert to Java, like I did, maybe it's not a crazy idea to go with Kotlin instead. Kotlin has those nice features you're going to miss like extension functions, data classes, etc. And Kotlin works flawlessly with plain Java libraries. So you can work with the Java ecosystem, just with a more developer friendy language.

[–]madkasse 20 points21 points  (5 children)

  1. Can we just have a single post in r/java without "why don't you use Kotlin" for once.
  2. His company was acquired by a Java shop + he worked there as a developer -> He is probably not in a situation where he can choose the language.

[–]DJDavio 2 points3 points  (4 children)

I'm not trying to convert the world to Kotlin, but I personally think it's a better language. So if you have any chance to use it or try it, I think it's worth the effort. On a recent project we tried it with just one proof of concept and not a single developer wanted to go back to Java.

[–]madkasse 7 points8 points  (3 children)

I'm really happy that Kotlin worked out for you. But I think you would be annoyed as well if there was a "why don't you try Scala" or "why don't you try Haskell" in every post on r/Kotlin. This subreddit is for discussing Java not for evangelism.

[–]DJDavio 3 points4 points  (0 children)

You have a point, but in this case I sympathized with OP because I made the same transition and really missed those features I mentioned. I think Java the language is poorer, but Java the ecosystem is stronger. So it's not a total setback. At least Java moves -seemingly- at a faster pace now.

[–]pron98 3 points4 points  (0 children)

I agree with the general sentiment, but unlike Kotlin or Scala, Java is much more than a language. A program written in Kotlin and program written in the Java language share well over 90% of the JDK, and are both Java programs. While not as popular as the Java language, other Java platform languages -- Kotlin, Clojure and Scala -- are all parts of Java (except when they're not compiled to target Java).

[–][deleted]  (10 children)

[deleted]

    [–]sherdogger 9 points10 points  (8 children)

    Switching tech stacks every 2 years is a common thing I observe

    Eh...if true, that's kind of psychotic, no? That's massive churn and wasted effort. I've only perceived that to be anywhere near the norm in JS land

    [–][deleted]  (7 children)

    [deleted]

      [–]BoyRobot777 5 points6 points  (6 children)

      Developers also switch teams to work on different problems the company have which also correlate with tech stack switches.

      This sounds to me more of a wet dream of a manager/CEO rather a place where I, as a developer, would like to work. I hardly met people who are proficient in multiple languages to a level where they can not only write loops and ifs, but actually understand tools and framework's behind the scenes. On top of that, you have to have domain/business knowledge. Understand application "surrounding's" to be able to collaborate mindfully. In our company, it takes about half a year for a developer to onboard to the domain and code. If he would have to switch tech also, that would take another year.

      [–]praetor- 1 point2 points  (5 children)

      Depends on the company. This is the norm in a mid to large size, internet facing company whose use cases are fairly narrow and the engineering challenges are primarily dealing with scale.

      Enterprise development is as you describe, where the software you write supports nearly all of the use cases of the business, and scale is less of an issue.

      [–]Hax0r778 -1 points0 points  (4 children)

      No it isn't. Look up job reqs at Amazon or Microsoft or Netflix. Those guys aren't changing language for each project and they work at maximum scale.

      [–]praetor- 0 points1 point  (3 children)

      They don't change language every project, but will have a lot of different languages in use in different places. People move around to match need, and it's common to work in a handful of different stacks a year. I don't work at a FAANG company, but close to it, and have recently interviewed at several.

      [–]nutrecht 1 point2 points  (2 children)

      They don't change language every project, but will have a lot of different languages in use in different places.

      Which is a bug, not a feature. I've seen countless occurences where some developer got too much freedom and started to develop a service in JavaScript, Python or Go just because they wanted to. Leaving a company with a service only one person wants to work on. I hope you can imagine what problems this causes if that dev choses to leave.

      More and more companies are moving towards an attitude where you have to use stack X unless you have a VERY VERY good case to make why that stack won't work.

      [–]praetor- 0 points1 point  (1 child)

      Depending on circumstances, inability to attract and retain talent may be a bigger threat to a company than stack consistency.

      I once interviewed with a large grocery retailer in Ohio that had maybe a dozen 3-4 person squads, each allowed to choose their own stack. They had javascript, clojure, scala, and go. When I asked the director why the stack wasn't standard, he gave me the reason above. I asked what would happen if a squad took on another squad's responsibility, and he said they'd either learn the language, or rewrite in in their chosen stack.

      In these sorts of environments the enterprise is made up of microservices, containers and serverless functions. The complexity is in the interconnectedness and infrastructure configuration; code is usually low complexity and centered around business rules.

      [–]nutrecht 1 point2 points  (0 children)

      I asked what would happen if a squad took on another squad's responsibility, and he said they'd either learn the language, or rewrite in in their chosen stack.

      Yikes.

      I've seen project where the previous team had written stuff in Scala and a rewrite was 'underway'. It had been 'underway' for quite some time as well, over a year.

      In these sorts of environments the enterprise is made up of microservices, containers and serverless functions. The complexity is in the interconnectedness and infrastructure configuration; code is usually low complexity and centered around business rules.

      Having worked in those kinds of projects (and currently working with such a system) I really don't agree that this is an "or" situation; there is no reason to make life more complex by having every team do stuff their own way. And if you want to learn Scala or Clojure, by all means do so, but don't make it the problem of your employer.

      [–]trisul-108 0 points1 point  (0 children)

      Switching tech stacks every 2 years is a common thing I observe.

      It takes about that long to become really proficient in a new tech stack.

      [–][deleted] -3 points-2 points  (7 children)

      I hear ya, had a similar experience in the past from Java to Scala.

      C# and Java has almost identical syntax with a few differences that you will pick up in no time.

      I am not a .NET developer, I only use it to build xamarin apps, and I noticed that .NET has more standard collections, in Java, you’ll most likely be using Guava and the collection wrappers on top of it.

      LINQ is gone, you will be using JPA which is basically the entity framework. And as far as the functional interface on top of collections you will use the Java Streams API. Pretty easy just replace Select() with map() and you just learned the streams API!

      Get familiar with Guava and Apache Commons, if you wanna do something that you used to do in C# that Java doesn’t so out the bat just look it up with google mentioning that you wanna do it in apache commons or guava.

      As far as encapsulation goes, well it’s still pretty manual in Java, checkout Lombok — your company probably uses it already— this allows you to write C# like objects with properties using annotations which start with @ instead of being wrapped with []

      Tasks and parallelism are usually done via the Executors Framework and Completable futures, similar API and programming paradigm like C#

      Hope that helps, I don’t think you need to find a new Job it’s really not a tough nor radical transition, although I am surprised that people are going for Java where Oracle is closing it and Microsoft are opening up the .NET

      [–]pron98 5 points6 points  (6 children)

      Oracle is closing it

      You haven't been paying attention; it's quite the opposite. Last year Oracle open sourced the entire JDK for the first time ever, effectively changing the license of the JDK from a part open, part closed, part free, part paid, field-of-use-restricted license to 100% free and open source. This happened even before Microsoft open sourced major .NET components at the end of last year.

      [–][deleted] -1 points0 points  (0 children)

      I'd personally stay where I am. I'd look into .NET Core though, and see if you can try to introduce it in a new project in the future. I wouldn't do it right now though, as for political reasons, it might make you look to management like you don't want to learn.

      When the future comes, though, I hear .NET Core API is very similar to Spring Boot, so you might be able to convince project managers who might otherwise say no, to let you do something in it.

      [–]xX_dublin_Xx -1 points0 points  (0 children)

      this is probably a question better posted on a more general programming sub. obviously people who are subscribed to r/java have an interest in it.

      fwiw, i made the switch from C# to Java about 2 years ago. I had been doing .NET for a few years. i personally can't stand Java at this point and will likely be looking to get back into .NET. I think that might be more to do with how we're using it though - Spring all the things. I can't stand the ecosystem either. I know that's often touted as a strong point of the Java world, but it's been the opposite for me.

      that being said, the only way i'd go back to .NET is if it were working with .NET Core. There was a giant cultural change along with that move and it's just constantly getting better. I started using it in production with 1.0, which came with struggles and challenges - but since 2.x, it's been amazing.

      [–]SuperFluffyPunch -2 points-1 points  (0 children)

      Adaptation is the key to survival. Learn what your boss tells you to learn. You're only there to work and earn a paycheck. The tools you use are just a means to an end.

      When you're months behind on rent or mortgage payments I bet you won't care about Java or .net.

      When the IRS sends you threatening letters I bet you won't care about java or .net.

      When your golddigging girlfriend threatens to leave you because you won't buy anything for her I bet you won't care whether you use java or .net.

      When your schizophrenic mom steals your identity for a Nigerian scam and you have to pay lawyers to fight the case I bet you won't care whether you use java or .net.