I’ve first learned Java in introduction to programming in 2001 and that’s what interfaces were for back then already.
Re:Don't Be Afraid of Types
by Viliam1234 on Saturday March 22, 2025 @10:50AM
(#43446039)
Interface are more fundamental to Java than classes.
Sadly, at the beginning, many people came to Java from C/C++, and they did the thing we used to call "writing C/C++ code in Java".
I'm late to the Java party, I first did anything serious in it in 2009-10 and it was Android not "traditional" Java. So no idea about early Java's history.
The interfaces is the only thing i loved from it.
Re:Don't Be Afraid of Types
by Viliam1234 on Sunday March 23, 2025 @09:07AM
(#43452643)
One day I will write a Java project that won't contain a single "class" keyword (it will have interface, anonymous classes, and static methods), as a piece of art.
1. This (or maybe a less trivial form of this) will bite you in the ass when you end up using other people's unnamed types. Or even when you use your own unnamed types that come from code you haven't touched in three years.
2. That's what interfaces are for in Java. Or at least modern Java.