Live data from Hacker News

Lombok makes Java cool again

bytes.grubhub.com

221–230 of 239 posts

Re: Lombok makes Java cool again

#221
post #111

Earlier quoted context omitted.

Your second paragraph has a direct-equivalence to complaining about return-types and advocating that everybody should just specify "Object" to make things easier. ( https://imgur.com/iYE5nLA ) In both cases it's about constraining and describing the results from a method. The only difference is that most developers are so much more accustomed to thinking and coding along the happy-path, where they will willingly do a…

Declaring only some of the things that might go wrong, which is the case with checked exceptions, does not solve the problem you described and only makes it more difficult to write code. If every kind of exception was checked, then every method in Java, including constructors, would need to declare that it throws RuntimeException and IOException and NullPointerException and NoClassDefFoundError and InterruptedExcepti…

> If every kind of exception was checked [...] When you solve the halting problem

Hold it: I said nothing remotely like that. You have begun ranting against an absolutist straw-man of your own creation.

What I DID say is that:

1. Type-checked exceptions are just as valuable as type-checked returns.

2. The "problems" you listed with checked-exceptions are baseless: Each of them is identical to an architectural decision or task you already regularly complete for happy-path return-types.

3. The fundamental driver of complaints is that people don't like to spend time on the unhappy-path, and aren't as rewarded for it either.

Re: Lombok makes Java cool again

#222

Reading this just reminds me of all the terrible things about Java. The lack of reasonable default string representations, comparison and hashing methods, etc. are all glaring mistakes in the language design that have wasted huge amounts of time for millions of programmers. It's as though Java programmers are so deep in the grips of Stockholm Syndrome that ordinary, sensible behaviour seems amazing and "cool". This i…

"Terrible" in comparison to what?

Re: Lombok makes Java cool again

#223
post #207

Earlier quoted context omitted.

How do you define pragmatic? Apache Groovy is still under active development. We've actually started using it more for green-field development where I work.

What exactly does "Groovy" offer that another JVM based language doesn't? Am genuinely interested.

Not the parent, but I prefer Groovy over other JVM languages because:

- supports both dynamic and static typing - it works just as well for bash level scripting as it does for full application development. For example, you can use it exactly like an interpreted language (no compilation needed).

- seamless Java integration. I know many JVM languages say that, but Groovy actually makes it one of its core features. It has a lower impedance mismatch than any other JVM language I've tried (and I try them all).

- partly because of the dynamic typing, it is able to support the most concise, powerful options in its syntax of any of the JVM languages. So you get more done with fewer, simpler lines of code

- because of the static typing and low impedance mismatch with Java, it can achieve very high performance. I was not able to get Scala to perform as well, for example, because of type conversions needed to invoke underlying Java library calls (unless you abandon idiomatic Scala).

Re: Lombok makes Java cool again

#224

Earlier quoted context omitted.

I am sorry to disagree but if you think that the iterator or visitor pattern or the state pattern or abstract factories are only bound to Java than you have a very low skills/understanding of those patterns and you really don't understand their importance and/or applicability.

I think it's a cultural thing. Other languages don't name things that seem obvious, like iterators or filters. Consider something like filepath.Walk in go; you give it a function that gets called for every file and directory in the root of your choosing. They don't call it a visitor, though, they call it a "walk function". It's just as clear, it's just as much of a design pattern, but they don't make a big deal about…

You sussed that out right! Thanks for explaining perfectly, and more rationally, what I was trying to express.

Re: Lombok makes Java cool again

#225
post #105

Reading this just reminds me of all the terrible things about Java. The lack of reasonable default string representations, comparison and hashing methods, etc. are all glaring mistakes in the language design that have wasted huge amounts of time for millions of programmers. It's as though Java programmers are so deep in the grips of Stockholm Syndrome that ordinary, sensible behaviour seems amazing and "cool". This i…

> all glaring mistakes in the language design that have wasted huge amounts of time for millions of programmers. i would think javascript is the language with which the mistakes wasted the millions in man hours, not java.

There are plenty of competitors! :)

Re: Lombok makes Java cool again

#227

Reading this just reminds me of all the terrible things about Java. The lack of reasonable default string representations, comparison and hashing methods, etc. are all glaring mistakes in the language design that have wasted huge amounts of time for millions of programmers. It's as though Java programmers are so deep in the grips of Stockholm Syndrome that ordinary, sensible behaviour seems amazing and "cool". This i…

Which design patterns are you thinking of and which languages had them? The original gang of four Design Patterns book is filled with C++ examples, most likely because almost nobody was using Java in 1995 outside of a few people at Sun. More generally comparison and hashing methods seem like small potatoes compared to locking primitives, portability, and a large, well-documented class library that have made Java idea…

I'm not saying Java doesn't have other strengths. It certainly does! It also has stupid weaknesses.

Many of the popular design patterns are simply lambda. If you have first-class functions, they are trivial. But Java doesn't have first-class functions; instead you have to write a giant thing that looks like a class, and because that feels like a lot of work, it seems to deserve a fancy name like Observer or Strategy. But it's all fabricated work; the only reason you have to do it is that the language has this stupid weakness.

It's as though you were working in a language that didn't have lists. And one day you realize, hey, it's useful to be able to manipulate variable-length collections of things. So you look at a problem and say "Aha, this is exactly the place that we should use a Collection design pattern" and you go write the entire implementation of lists from scratch and feel satisfied that you did a good day's work. You tell all the programmers you know that there is this great design pattern called a "Collection" that they should all start using. You write books about it. You give workshops. You get really good at writing list implementations, because every time you need one you implement a new list from scratch.

When you tell a Python programmer this, she looks at you like you have lost your mind, writes a function that takes a list, solves the problem in 5 minutes, and gets on with her day.

Re: Lombok makes Java cool again

#228
"Again"? That seems to pre-suppose a counterfactual.

Counterfactuals can be cool, but you have to explore them, not pre-suppose them. Pre-supposing them is definitely not cool, which calls into question the ability of our interlocutor to recognize what is and (more pointedly) what is not.

Re: Lombok makes Java cool again

#229
post #194

Earlier quoted context omitted.

STL wasn't a thing, but MFC, OWL and ATL surely.

These were also closer to Java libraries of late 90s in design. Even ATL mostly used templates to optimize (using the curiously recurring template pattern, usually). Qt was also born in that era, and look at how strikingly similar its standard library is to Java's in many cases, and how unlike STL and Boost.

The way you state it feels like it was C++ that copied those designs, when it was the other way around.

I cannot speak for Boost, but STL is also not free of OOP as such, iostreams, data-structures, allocators.

ATL was all about using templates, as optimization or not, one is on template land when using ATL, it is even part of the name.

Re: Lombok makes Java cool again

#230
post #82

Earlier quoted context omitted.

I can read Scala fine but I'd like fast compilation and good IDE support.

The IDE support is pretty good these days, as least in IntelliJ.

Agree. In fact, we have a rule in our team that if a feature is not supported by IntelliJ, then it's probably too arcane and should not be used.
Post reply on HN