PutFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleIdResponse

In a project we’re working on, a Java source file is auto-generated: method names on the interface that is generated (ready for implementing) are based on the HTTP method and URL in the RAML.

The result is this:

asyncResultHandler.handle(Future.succeededFuture(
    PutFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleIdResponse
        .withNoContent()));

What we have here is a single identifier that, at 83 characters in length, is too wide to fit in standard 80-character-wide terminal.

File under “Why Java Is Not My Favourite Programming Language”.

(No, there is no reason why a similar identifier could not in principle be generated in some other programming language. But no other language has the programming culture that make such things possible.)

Advertisements

9 responses to “PutFixedDueDateScheduleStorageFixedDueDateSchedulesByFixedDueDateScheduleIdResponse

  1. rogerlipscombe

    If it ends up in a file named after the class, you’re quite likely to hit filesystem limits on maximum path or filename length, too…

  2. I’ve never warmed to Java: I guess this sort of thing is part of the reason, which is that it’s just fugly. I’ve seen so many examples of it where it also seems to be structured in a leggy and ill-formatted manner too; I guess part of me is also somewhat bothered about its performance but I’ve never actually got far enough to know if that’s actually true or if I’m just seeking some justification for why I don’t like it.

    Okay, I can hardly comment as I’m a C hacker and I had to be dragged kicking and screaming into using ANSI-style declarations and a full-screen editor; but as much of a tedious pain in the arse as it is, it still has its own sort of elegance, or at least many of its adherents try to achieve something approaching one. But Java… meh.

  3. Whatever faults Java has, performance is really one of them.

    As I’ve said before, my problems with Java are nearly all with the community and practices that surround it — not the language itself, which is pedestrian but clean and fairly expressive these days.

    But it absolutely doesn’t have the the elegance and precision of C.

  4. I suspected that was most likely the case. Java culture seems to embrace a really horrible coding style for no reason I’ve ever been able to figure out, and now that you’ve mentioned K&R, too much stuff that’s been written about it seems too woolly and content-free.

    Talking of K&R, how come Dennis Ritchie is practically unheard of when some knob like Steve Jobbies is venerated? I definitely think there should be a St Dennis, the patron saint of programming. I was fortunate enough to have an albeit *very* brief exchange with him on Usenet: nice guy and certainly not too important to speak to the likes of us.

  5. Java’s poor performance is a bad meme. It’s faster than anything excepted language with manual memory management (or Rust, and I’ll allow you can probably construct some reasonably equivalent Go programs that are faster than their Java counterpart).

    Java can even yield programs that yield better performance that their non-optimized C counterparts, because of the JIT. I have seen this happen (mostly the case involves loops with multiple paths and Java being able to determine which paths are overwhelmingly taken and optimize that).

    Of course, with JVM startup time, it’s never going to cut it for really-snappy command line apps (there are workaround around this, like having a daemon that pre-spins VMS — but workarounds is what they are).

    I intensely dislike the prevalent Java design ethos. A few culprits:
    – accessors everywhere even though there is no chance in hell the field will go away
    – premature over-abstraction (usually manifested in factories)
    – overuse of inheritance over composition
    – decoupling interfaces from implementations prematurely
    – premature use of dependency injection, or cases where its benefits don’t outweigh the added the costs

    That being said, Java in itself is a really-well designed language. It had ups and downs: generics were slightly botched, but they are good enough, but lambda are very well designed and implemented.

    If I were starting from C/C++ and about to make something that is still close, at the time were java was made, but much safer and convenient to program, I would probably have ended up with something similar. It fixes all the safety (undefined behaviour, overflows, leaks) and productivity (manual memory management, lack of polymorphism) of C/C++ at a minimal cost (well, the early versions of the JVM were quite slow…).

    Java is uncool and will remain so, but to me it has not deserved it’s reputation as a terrible language, quite the contrary. It’s a reliable and well-worn tool. The corporate culture that has sprung up around Java is really to blame. There is nothing in the language that encourage class names to be so long.

  6. All of that sounds right to me, Nicolas — except that I don’t think I’ve really encountered “its reputation as a terrible language”. More often, I see an uncritical acceptance of it, and even devotion to it, as The Only Programming Language In The Whole World. (Something that is encouraged among its users by the community’s insistence on never, ever using any tool that is not itself written in Java.)

  7. I also haven’t encountered that reputation: I just don’t especially like it. I should probably add that my last “significant” experience of it was back in the ’90s so I imagine quite a lot has happened since then; but even at the time there was some rather rampant fanboyism about how it would oust all other languages. And there was a lot of ugly code.

  8. Java’s the new language taught in schools and used in business. It’s entirely natural that it’s going to get this type of culture attached to it, and it’s got something of a reputation as a terrible language because of that. It has a deserved reputation for boilerplate, and it’s not usually going to be as fast as C or C++. I’ve heard part of it is generational; it’s no longer this cleaned-up version of C++ that’s radical and new, it’s the first language taught for many students.

    It’s not the radical functional programming languages, or the low-level hardcore C, or the hacker-made Perl, Python or Ruby. (Though I’m curious if my generational bias is missing me there, as many new programmers could have been taught Python as their first language.) It’s not anyone’s dream language anymore, but it’s the language that a lot of things get done in. It’s the station wagon, not the sports car or the four-wheeler.

  9. I was using Java a few years back to write some Android code, and my main take on it was that it was clunky. It seemed like I had to write an awful lot of code just to do simple things. The IDE was also clunky, but gave the impression of being awkward but comprehensive. A lot of my problem with its is aesthetic.

    It doesn’t help that the Java system seems to request security updates every few weeks. I suppose this means that bugs are being actively fixed, but it adds to the clunky feeling.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s