r/learnprogramming •

Confused by intermediate Java

[deleted] — view deleted post

0 Upvotes

5 comments sorted by

View all comments

•

u/xarop_pa_toss 16m ago

Ah yes, you have reached the "OOP is bullshit" level. Especially when you know C or Rust like you mentioned, all that added nonsense feels really unnecessary; and to a certain degree it is.

Most people will probably recommend Clean Code by uncle Bob. It became the industry standard book but nowadays a lot of devs think it was a step in the wrong direction.

I use C# instead of Java but it's basically the same thing and the way I got accustomed to it was to actually ignore a lot of features.

  • I almost never use Inheritance. Composition as become the standard I'd say.
  • Interfaces are your friends.
  • Generics are very useful imo. You can write a single parent function that takes any datatype and then you can activate other things according to what was sent in for example.
  • I don't like Lambdas so I don't use them. I understand what they are but I'm confused by them.

What helped make some things click was learning some of the more commonly used Design Patterns. Façade, Factory, Strategy, and others are things you might do naturally in your own code but when you practice them a little bit you'll see that "oh, making this class with different overrides allows me to do X here" for example.

I don't really have a book recommendation on this, except the refactoring.guru website