Live data from Hacker News

Love It or Hate It, Java Continues to Evolve

azul.com

91–100 of 156 posts

Re: Love It or Hate It, Java Continues to Evolve

#91
post #58

One thing I would really love to see is a better way how you manipulate strings. Variable interpolation would be nice and you wouldn't have to have all that ugly string concatenation all over the place.

Don't forget regular expressions. How anyone puts up with having to escape all backlashes is beyond me. But, then, I'm used to Perl and Ruby. Scala, Clojure and Kotlin don't have this problem so why is the Emperor Without Clothes That Is Java having such a hard time?

Re: Love It or Hate It, Java Continues to Evolve

#92
My biggest issue with Java isn’t even the language, it’s the culture. I feel like typical Java solutions are just layers upon layers upon layers upon layers of abstractions, frameworks inside of frameworks, and stack traces taller than skyscrapers. It’s just too much!

It seems like the Java community has lost the art of coding without a framework. It feels incredibly bloated and entirely too magical. But this has more to do with the ecosystem and philosophies of the community, rather than the language, or even runtime, itself. From a purely language and runtime perspective, I think it’s fine.

But I don’t enjoy it. Every time I need to work on a Java project, it’s like it’s a form of punishment. I’d rather do basically anything else.

Re: Love It or Hate It, Java Continues to Evolve

#93
post #27

Java 8 made it an "okay" language for me to use. It's a lot better nowadays, but historically the biggest problem with Java has been the 3rd party libraries. They tended to be written with extensibility in mind at the expense of usability. Extensibility is great, but it's not the only important thing in a design. I'm not a huge fan of annotations. It makes the language feel a bit magical and hard to debug in some pla…

99% of the time I see DI used in Java it is solely to enable mocked dependencies in unit testing rather than injecting different production implementations depending on environmental differences or something like that. I have had Code Reviews where "This is all good, but you should use Guice to mock X" where X is the one time I might have a package-private test only constructor with a NullObject for the one dependenc…

Dynamic languages like Python do not have this issue as you can mock any method runtime for the duration of test. This can done via "monkey patching". It is unclean, but the development cost of having a framework to do just this is a tad high.

The only downside is that if you parallel test you need to run them in separate processes (which you usually want to do.any case).

Re: Love It or Hate It, Java Continues to Evolve

#94

Earlier quoted context omitted.

In Kotlin, so you don't have to define multiple files, obviously skipping the imports. Let's do the same with Jooby, for instance: fun main(args: Array ) = run(*args) { get { "Hello Kotlin" } } It's always easy to make a framework lightweight. But there is no argument that Spring requires a lot of tedious boilerplate in Java (some of which can be avoided with Kotlin), and annotations which are hard to understand. Lig…

I understand, and I used to be in the sinatra camp a decade ago. What I really disliked with spring/tapestry and rails was the (at the time) huge stack trace and memory usage. The annotations I used were "this is a spring boot application" on top of a class and another which says "this is a rest controller" to start your hello world application and we only saved a few lines and introduced additional hidden complexity…

I don't want to have to learn a brand new syntax to get things done.

Your Spring example immediately turns me off because it uses a bunch of annotations that could do pretty much anything (and I'd have to learn). Further, it uses kotlin which is not java - it's a valid choice but it's a more terse language in general (so not necessarily valid to compare against java examples).

Spark is straightforward and easy to read, it does one thing and it does it well, and it doesn't demand that I spend a lot of time thinking about anything other than what I'm trying to achieve. I have a lot of time for that.

For the record, with kotlin and skipping imports (of which there would only be one anyway) -

  fun main(args: Array) {
      get("/hello") { req, res -> "Hello World" }
  }
I do indeed find this simpler than your proposal upthread.

Re: Love It or Hate It, Java Continues to Evolve

#95
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

I find the Java love/hate intriguing, I personally like the ideal of 'getting the job done'. Pre Java 8 is just fine, I don't think it's materially changed, I think what has changed is perception i.e. the realization that all that Enterprisy cruft 'does not equal' Java - nor do wee need FactoryFactor patterns. My wishlist: - Stream syntax was nice, but a little clumsy - In addition to data objects, some kind of 'un-t…

> Async notation as a better way to express threads

CompletableFutures?

You don't deal directly with threads in java (unless you want to) these days.

Re: Love It or Hate It, Java Continues to Evolve

#96

My biggest issue with Java isn’t even the language, it’s the culture. I feel like typical Java solutions are just layers upon layers upon layers upon layers of abstractions, frameworks inside of frameworks, and stack traces taller than skyscrapers. It’s just too much! It seems like the Java community has lost the art of coding without a framework. It feels incredibly bloated and entirely too magical. But this has mor…

It's interesting how differently developers respond to languages and their ecosystems. While I don't love Java, i think it's fine. The documentation is very good and interoperability is excellent. Far from a punishment.

Punishment for me is PL/SQL which, despite its charming Pascal-like syntax, is painful to work with due to the lack of good tooling and it's awkward constructs (string handling, exceptions, etc.)

Honestly, despite its popularity, I feel the same way about Python. Working in Python on anything larger than simple scripts is difficult due to the packaging mess, the 2/3 issue, it's sometimes unintuitive idioms (think "".join(...)). Ruby is probably the most pleasant ecosystem I've worked with but I find dynamic typing a challenge on large projects. Point being, if I were starting a project in a corporate environment, Java (or at least the JVM) would be my default choice. Java seems to occupy a space where it's good enough or "least offensive" to the majority of the team.

Re: Love It or Hate It, Java Continues to Evolve

#97

My biggest issue with Java isn’t even the language, it’s the culture. I feel like typical Java solutions are just layers upon layers upon layers upon layers of abstractions, frameworks inside of frameworks, and stack traces taller than skyscrapers. It’s just too much! It seems like the Java community has lost the art of coding without a framework. It feels incredibly bloated and entirely too magical. But this has mor…

To me you're talking about the java of a few years ago. It's really not the case now.

The enterprise-y types are no longer dominant in the space.

Re: Love It or Hate It, Java Continues to Evolve

#98
post #11
post #2

I think the reason so many people have mixed feelings about Java is that "Java" is actually several things: - The Java language - The Java API (and/or whatever set of libraries you're using) - The Java ecosystem, tooling, etc. - The sorts of work typically done these days with Java It's perfectly possible for one person to feel strongly one way about some of those aspects while feeling strongly the other way about ot…

> "Enterprise Software" CRUD-churn I did some Java in the late 90s at university, and a tiny bit in about 2001, pre-dating a lot of the enterprise stuff. I've come back to it in the last three or four years and it's currently my main language. I think I manage to miss the enterprisey stuff. I remember J2EE happening to other people, and then for a while everything was Spring. Somehwere in there were 'Beans' Now ... I…

If you have a strong background in both C and Java, I’d encourage you to give Go a fair shot. I also had long runs with C and Java, but ever since I’ve tried Go, it has become my favorite Swiss Army knife. Basically, it’s my default language until I have a reason not to use it.

Re: Love It or Hate It, Java Continues to Evolve

#99
post #34
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

Big fan of sparkjava for no-nonsense HTTP services. The days of tomcat-for-everything were not fun as someone who only occasionally dabbled in java back then. So I have to build this as a special type of jar and then set up this other, rather opaque, set of stuff and deal with all sorts of nonsense ... Now? get("/hello", (a,b) -> "Hello World"); And we're done...

In Scala using Cask it's

    object MinimalApplication extends cask.MainRoutes{
      @cask.get("/")
      def hello() = "Hello World!"
    
      initialize()
    }
API design shamelessly stolen from Python's Flask framework

Re: Love It or Hate It, Java Continues to Evolve

#100
post #19

Earlier quoted context omitted.

Any language that will survive as much as Java or C++ will accumulate some baggage, even your cool shine new language will look outdated 20 years from now to the new cool programmers. Look at other examples, CSS - full of bad examples on how do do X, JS - a lot of bad parts, missing core stuff like importing modules , Python - it had is issue caused by some old decisions that caused a lot of pain when migrating versi…

The point is to work at the sweetspot of emerging language/high pay and then get out once the framework decision level bugs start emerging. Then come back as a consultant in 20 years at the intersection of high pay/no one else can figure out how to fix the software. If you're working with Java you're mostly in medium pay/tearing hair out coz of legacy issues-which you WILL have because a Java shop never COMPLETELY mo…

>If you're working with Java you're mostly in medium pay/tearing hair out coz of legacy issues-which you WILL have because a Java shop never COMPLETELY moves to the new thing. Not a fun place to be.

I am working in the present on Web tech, SPAs, but you know what, it sucks even if is the cool thin, the project was started with angular1 which is no longer the cool thing, it uses ES5 and gulp(no longer the cool thing), the backend uses Silex(a PHP framework that is not that cool) ...

The only cool thing I assume is to start new project in the this month cool shit and then after 1 year move to the new shiny and let people like me maintain your inexperienced code in the experimental shiny thing of last years.

Post reply on HN