Live data from Hacker News

Java: Real or Not?

java.metagno.me

11–20 of 68 posts

Re: Java: Real or Not?

#11
Most of the atrocious stuff is in J2EE related frameworks (looking at you spring and hibernate).

I think core java libraries are amazingly designed and a good part of why the language became popular. You won't find many FactoryFactories there, The land of c,c++ libraries that came before is incredibly fragmented, inconsistent and difficult to use by comparison, not to mention the documentation. Good lord the docs ;x.

Re: Java: Real or Not?

#12
Some answers are not 100% right. I got:

- HttpServlet

- AbstractXmlWebMvcResultProcessingInterceptorAdapter

- MockJtaTransaction

While there is HttpServlet class, it is considered wrong, and 3rd option is considered correct :(

Re: Java: Real or Not?

#13
Note that some classes exist (even if not in Spring, at least in base Java) http://imgur.com/sNk4mE2

The key thing to keep in mind with generative models based on real data is that just because results were based on random generation doesn't mean they can't match something real.

Re: Java: Real or Not?

#14
The names are extremely predictable (as shown by this Markov chain), which is actually a Good Thing (tm). The bad thing is that things got complex enough to warrant these names.

It's the knee jerk reflex of decoupling everything, to the point that you have 80% configuration/wiring/setup vs 20% of code that actually does something useful.

Each extension point in the framework is represented by a couple of these classes to handle the layer of indirection. Maybe Spring should run a study and see which of their extension points is actually used, at all, or by more than x % of users, and then cut down all the useless ones. I'm not too familiar with Spring these days, but I'd expect that the vast majority of indirections isn't actually useful for anybody.

The other problem is that our mechanisms to introduce and handle these abstractions are too verbose. Each extension point spawns multiple classes where it's really just one little method that needs to be called instead of another block of code. That makes software systems extremely hard to understand and use, and the overall bloat does actually slow things down - if not in production, then in deployment, startup, and build.

Re: Java: Real or Not?

#16
post #10
post #4

It never hurts to study the masters in serious enterprise software: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

This is great but it brings up a serious question I've always had. Taken to the extreme, things like the single responsibility principal, the open closed principal, etc, result in messes like this. I've been wondering if anything has been written around a concrete methodology of doing OOP that doesn't naturally converge onto something like this, and why it happens.

Unfortunately, it's more of an art than a science. The simple rule is: it should be as simple as possible, and no simpler than that. Obviously, everybody has a different idea of where exactly that line is.

Usually though, if you try to make the code clean and as small as possible while still allowing unit tests to be written, you normally hit a decent spot. YAGNI applies very heavily here too and it's often better to make the code less generic and refactor it later when required.

Re: Java: Real or Not?

#17
post #12

Some answers are not 100% right. I got: - HttpServlet - AbstractXmlWebMvcResultProcessingInterceptorAdapter - MockJtaTransaction While there is HttpServlet class, it is considered wrong, and 3rd option is considered correct :(

It's only talking about classes from Spring specifically. HttpServlet isn't a Spring thing.

Re: Java: Real or Not?

#18
post #10
post #4

It never hurts to study the masters in serious enterprise software: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

This is great but it brings up a serious question I've always had. Taken to the extreme, things like the single responsibility principal, the open closed principal, etc, result in messes like this. I've been wondering if anything has been written around a concrete methodology of doing OOP that doesn't naturally converge onto something like this, and why it happens.

I use Spring and I'm not agree that it's a mess. It has a lot of functionality but good architecture allows to keep it under control and easily enhance when needed. Spring is one of the best open source frameworks I've ever seen.

Re: Java: Real or Not?

#19
post #5

It's not surprising that a Markov chain could put together plausible sounding class names, because yeah, there are definitely patterns that class names fall into. What's surprising is that one third of the names it's showing me are actually real. I mean, "MetaMetaContextHierarchyConfig" actually exists?

> I mean, "MetaMetaContextHierarchyConfig" actually exists? Apparently. https://github.com/spring-projects/spring-framework/blob/mas... "Custom context hierarchy configuration annotation that is itself meta-annotated with MetaContextHierarchyConfig"

It's worth pointing out that this is test code.

Re: Java: Real or Not?

#20
post #10
post #4

It never hurts to study the masters in serious enterprise software: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

This is great but it brings up a serious question I've always had. Taken to the extreme, things like the single responsibility principal, the open closed principal, etc, result in messes like this. I've been wondering if anything has been written around a concrete methodology of doing OOP that doesn't naturally converge onto something like this, and why it happens.

You might enjoy this: http://mollyrocket.com/casey/stream_0019.html

I think the problem is that OOP is automatically considered "virtuous", despite the context. There's nothing wrong with the single responsibility principle and what not, but there is something wrong with thinking that classes and objects are always the best way to approach a problem. Java ends up being the target of jokes because by forcing everything into classes/objects even when it doesn't make sense, it leads to cartooned versions of those ideas.

Post reply on HN