2 ms·
> You need to inherit to create anything that is a class That's true of the Java compiler, for which the documentation is strewn around the intenet...but an ex
by Supermancho 3y ago
> You need to inherit to create anything that is a class
That's true of the Java compiler, for which the documentation is strewn around the intenet...but an example is here: https://medium.com/javarevisited/compiler-generated-classes-methods-and-fields-in-java-343dde2cce61 https://medium.com/javarevisited/compiler-generated-classes-...
The Java syntax doe not require extending Object explicitly.eg This is a valid, useless, class:
public class App {}
> I don’t like modern Java because there’s too much non-Java magic code
It seems like this is the common path for popular languages. They develop their own library-backed DSL's for the most common use cases, which are often little more than macros (@data @getter, @notnull, etc). I am biased by what I've seen in the last 30 years though.
- chii 3y agoThe OP/GP wasn't really complaining about inheritance, despite the fact that this is what they wrote. The OP is complaining about the difficulty of the API because it is _exposed_ through inheritance. The complaint about `SpringBootServletInitializer`, for example, is exactly this. There's nothing wrong with inheritance. In fact, SpringBootServletInitializer is exactly what you want to use inheritance for - because you need to build your app using the servlet api. There are http servers that aren't servlet api, such as https://vertx.io/docs/vertx-web/java/#_re_cap_on_vert_x_core_http_servers https://vertx.io/docs/vertx-web/java/#_re_cap_on_vert_x_core... , which uses little to no inheritance (since the api surface is smaller).