r/learnprogramming • • 20d ago

Suggestions regarding programming

I'm 18. I'm currently learning Java and I feel I'm unable to understand stuff in it, especially object oriented programming. The practice feels like I'm falling behind.

14 Upvotes

39 comments sorted by

View all comments

Show parent comment

1

u/kpg_on_ao3 20d ago edited 20d ago

I think classes are easier than C structs bc languages with classes usually don't require you to manage memory, pointers, etc.

It's certainly easier to handle Java-style than C structs, which is why Java for a while was the language of choice for Intro to Programming classes, and several professors believed C should be the language because it was harder and thus would weed out dumb students from CS departments.

I lived through this. I did C and C++ at my local community college as a high schooler, but then my state's biggest research university switched to Java, so AP Computer Science switched to Java as the language for the exam.

The switch was because Java was easier.

C structs are objects anyway. But C isn't object oriented because the language isn't built around structs (i.e., inheritance, etc.).

1

u/Traditional_Vast9419 20d ago

In Java, the garbage collector is a separate mechanism from a Class, and structs have no inheritance.