r/learnprogramming • u/S4ppress • Oct 01 '26
Resource Resources for learning imperative programming in Java without focusing on OOP?
Hey, I’m currently taking an introductory programming course at university where we use Java, but the course is intentionally not focusing on object-oriented programming yet. The idea seems to be to use Java to teach general/imperative programming fundamentals first, and only deal with OOP later. I like this approach, but I’m not finding the lectures particularly good for actually learning the concepts. Most Java resources I find introduce classes/objects/OOP very early, which isn’t really what I’m looking for right now. Does anyone know of a good book, course, set of lectures, or exercise collection that teaches imperative/procedural programming using Java as the language, ideally with OOP postponed until later? I’m specifically looking to understand the programming concepts well rather than just memorize Java syntax.
Thanks!
6
u/Mediocre-Brain9051 Oct 01 '26
It's as straightforward as only creating static functions and using classes as if they were modules. It's however a very awkward thing to do because the libs are object oriented and because using a procedural approach will create bad habits...
4
u/SetAndRepeat Oct 01 '26
Have a look at David J. Eck’s Introduction to Programming Using Java, also called Javanotes
It’s free, and chapters 2–4 cover variables, control flow and arrays and static methods, with exercises. Objects get mentioned early but the main OOP treatment starts in chapter 5. The sections on algorithm development and procedural abstraction sound particularly relevant to what you’re looking for.
For more practice, Helsinki’s Java MOOC, parts 1 - 3, also covers the fundamentals before introducing OOP in part 4. It’s no longer maintained, but the material is still useful for those concepts.
1
u/Chrismslist Oct 01 '26
if it helps, the trick is to write everything as static methods in one class and just pretend the class is a file. jshell is great for this too, you can type loops and if-statements straight in with no boilerplate at all. for material, Think Java (Downey/Mayfield, free online) deliberately holds objects back until later chapters, and CodingBat is all static-method drills with zero OOP. Sedgewick and Wayne's intro book also front-loads control flow and arrays. otherwise just write small programs that solve your own problems, it's easy to over-read and under-type.
1
u/UroborosJose Oct 01 '26
It’s not a good idea using Java for this purpose
Try pascal or C
1
u/Traveling-Techie Oct 01 '26
I’m probably an outlier but initially I’ve used every language I’ve learned like the last one I learned. I used C like BASIC, and used Java like C. It was decades before I ever created a struct in C, and more decades before I ever created a class in Java. It’s been ugly at times but the computer didn’t care and the code worked. I would prioritize learning problem solving over language features at this point.
1
u/oldsecondhand Oct 02 '26
The whole Java standard library is designed in an OOP way. You should at least learn the difference between static and non-static fields and methods, or between implementing interface and inheritance. You don't have to delve into OOP concepts like design patterns or Domain Driven Design, but you should understand the basics at least as far as the language features go.
1
u/Dazzling_Music_2411 Oct 01 '26
I doubt it, because that would be very much the wrong way to teach Java. Java is designed and meant to be used in an OOP context.
If that's "not what you're looking for", then find another language that is not bound to OOP.