from Hacker News

Java: Real or Not?

by mechazawa on 6/6/15, 4:49 PM with 66 comments

  • by overgard on 6/6/15, 6:19 PM

    It never hurts to study the masters in serious enterprise software: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
  • by Nitramp on 6/6/15, 6:47 PM

    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.

  • by parasubvert on 6/6/15, 8:19 PM

    This is sort of like making fun of German for using long combinations of smaller words to denote a concept.

    Or making fun of medical jargon. (ha ha, you said subdermal hematoma not bruise)

    Once you know what the individual words mean, you can use them in different places, and know right away what the class does. Do you need to use 80% of these? No, but they're there, like parts in a car, in case you need to tinker.

  • by soup10 on 6/6/15, 6:45 PM

    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.

  • by mkozlows on 6/6/15, 6:19 PM

    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?

  • by elevensies on 6/6/15, 6:38 PM

    Are the generated names verified to be non-real? There could be some overlap.
  • by haddr on 6/6/15, 6:46 PM

    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 :(

  • by clamprecht on 6/6/15, 6:24 PM

    Are you calling the Spring developers Markov chains?
  • by tibiapejagala on 6/6/15, 7:36 PM

    I don't like complaining about submissions not working in my browser, but this time I feel like I'm missing a lot of fun.

    On Firefox DevEdition nothing past "Pick the one that's not made up!" appears. On latest IE it's every time "ComplexPortletApplicationContext.EditController" vs "ModelMapBasedHandlerMethodProcessor" vs "AbstractPlatformTransactionAttributeSource". 16 times the same question. Well, this could be just bad luck if questions are random. With randomness you never know.

  • by lkrubner on 6/6/15, 6:07 PM

    "The principle of least surprise" is sadly missing from this API.
  • by kaddar on 6/6/15, 6:47 PM

    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.

  • by dmcg on 6/6/15, 6:56 PM

    Nice. We made fridge-magnets in my last project to help generate excellent names like these.
  • by impostervt on 6/6/15, 10:34 PM

    Spring is not the only framework with bad names; look at this class name from aspectj:

    org.aspectj.weaver.patterns .HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor

  • by billrobertson42 on 6/7/15, 6:50 PM

    It's utter bullshit to conflate Spring and Java like this.
  • by ibejoeb on 6/6/15, 6:06 PM

    It's been a few years since I've seriously used Spring, but I when I did, I used the hell out of it. I'm pretty surprised by how many times I was fooled.
  • by dschiptsov on 6/7/15, 8:51 AM

    Like any other primitive, dogmatic religion, Java will stay for ages, because there will never be a shortage of idiots to repeat the dogmas and mediocries to have a decent living by manipulating the crowd.

    Java is triumph of the "packers mindset".

    http://the-programmers-stone.com/the-original-talks/day-1-th...

  • by peterashford on 6/7/15, 9:05 AM

    Nice job blaming all of Java for Spring's foibles
  • by davelnewton on 6/7/15, 12:30 PM

    The chained names are often too long; I find it hard to believe that my very rusty Java/Spring is the reason I got almost all of these right.
  • by jhallenworld on 6/7/15, 2:24 AM

    It amuses me that names in Verilog 1995 (a language with no structures) look pretty much the same: oc48_transp_decode_data.
  • by ExpiredLink on 6/6/15, 7:57 PM

    HN goes reddit. Java, oink, oink, lol!