DEV Community

Discussion on: A c# dev starting a Java course

Collapse
 
fnh profile image
Fabian Holzer • Edited

You are the first person I ever encounter to complain about lack of Intellisense in a Java environment, also and the first ever to mention BlueJ (which seems to be an educational environment, outcome of some university project). Please consider giving IntelliJ or Netbeans (or even Eclipse) a try. If you then still see something missing, I'd love to read about it.

Also, Java 10 brings local variable type inference with var into the language. Okay, it's only been some month and certainly won't be in most books, let alone university courses.

With regard to primitive types: you're right to mention it, but I have the impression, that you did not yet come along the fact that for every primitive type (starting with a lower case) there is also an Object wrapper class. Please read up on the concept of autoboxing.

You rightly noticed that Java uses different naming conventions with regard to methods than C#, namely lower instead of upper camel case. That is a convention only, but you should use it, because it is ingrained in the whole ecosystem. It is only a matter of getting used to. I took up C# for a project after 5 years of a lot of Java and I also needed to adjust. A language comes with idioms, this is simply one of many.

I wholeheartedly agree with your issues about getters and setters. The pain goes away with a proper IDE (to fire up code generation in IntelliJ, which for example creates getters and/or setters, hit Alt+Insert). That, or Project Lombok (although, I'm not a fan of too much magic). But C# does it better. Well, it had time to learn from Javas mistakes and some of the best language designers that are active in this industry: Anders Hejlsberg. It also didn't hurt that they had a FP/Haskell expert like Erik Meijers to design LINQ. That is really a well designed API.

With regard to learning idiomatic Java, I'd like to commend the recently released third edition of Joshua Blochs "Effective Java" to you, once you mastered the basics. As a matter of fact, if there is only one Java book you ever read, make it that one.

Collapse
 
alexs1305 profile image
Alex Shannon

Thanks for the tips and the comments. I have installed IntelliJ and have had a much better experience with this, my complaint was more the fact that I'm forced to use BlueJ which just mean switching between the two.
On the use of var's, I didn't know that the latest version supports this so I'll have to give that a go, there might also be some extra new functionality that is nice as I think I'm currently working on v8.
I'll be sure to get a copy of that book as well!
p.s. I agree that c# has had a lot of help getting to where it is and if I'm remembering some of the people who worked on java also contributed to starting c#?