News for hackers. Stuff that matters.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by tasubotadas on Tuesday October 04, 2022 @06:13PM (#33087803)
No idea why you decided to lump Java together with these abonimations.

Java by itself is an extremely simple language.

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by tonyarkles on Tuesday October 04, 2022 @07:44PM (#33088803)
For me, one of the biggest problems with Java is its simplicity. Because of the lack of "power tools", you end up with things like dynamically assemble class instances using either XML or magic (see Spring), and adding functions at compile time (see Lombok). The last time I worked on a Java project, it was practically impossible to predict how the system would actually behave at run-time; my joke was that a lot of these tools took issues that could have been detected at compile-time and instead converted them into run-time errors.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by renewedrebecca on Tuesday October 04, 2022 @09:32PM (#33089907)
I've worked just about every day with Java for the past 22 years, and you've hit the nail on the head with the problems.

I really prefer environments where you could start with main() and figure out the behavior from there, and things like Spring make that impossible.

Really, if java only had lambdas and lisp-y macros from the beginning, we wouldn't have these problems.

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by bheadmaster on Wednesday October 05, 2022 @04:11AM (#33092672)
> I really prefer environments where you could start with main() and figure out the behavior from there

This is one property of Go that I really like. Because of lack of constructors/destructors/magic functions and all that jazz, the only functions executed in a Go program are functions explicitly called through main().

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by noisem4ker on Wednesday October 05, 2022 @01:19PM (#33098418)
Watch out for init() [1]. Apart from that, however, I agree about the general lack of magic in Go.

[1] https://go.dev/ref/spec#Package_initialization

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by moring on Wednesday October 05, 2022 @04:15AM (#33092694)
IMHO, in retrospect, runtime access to annotations was a mistake. Possibly the level of reflection it offers, too. These two make all that code possible that cannot be understood statically.

And yes, lambdas and macros would probably have been a good replacement for that those two were originally meant to achieve.

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by jcelerier on Wednesday October 05, 2022 @09:30AM (#33095320)
It made a ton of software possible that wouldn't even exist otherwise. We don't have runtime access to annotations in c++ and it's a constant PITA as soon as someone wants to make something as basic as generating a GUI automatically from a data model, which is maybe 50% of what programmers do all day in the world
Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by moring on Thursday October 06, 2022 @02:04AM (#33104910)
I first wanted to write: Generating a GUI can happen as a fully automated build stepü, without runtime reflection.

But then I realized that such build steps re-introduce the same problems as runtime reflection does: You cannot understand the code statically.

So, yeah, maybe reflection and annotations are simply an overused hammer that makes everything look like nails... It feels like every library goes out of its way to use annotations for everything, completely defeating type-safety and static analysis. When it should actually be like, "is there really no way we can solve this without annotations and reflection".

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by jcelerier on Thursday October 06, 2022 @08:38AM (#33107487)
Note that what I'm talking about is perfectly doable without any runtime reflection at all, only through static compile-time reflection. E.g. attributes in c++ are a purely compile-time thing - if there was an API to do stuff with them it would also be a compile-time one. The code isn't meaningfully different though.

But yeah, "fully automated build step" generally looks like "let's parse enough of the language so that we can implement our own custom reflection system" which leads to every project having an incompatible one and in practice much more pain (and macros) for the developers than if it was a standard one, e.g. Qt, Unreal Engine and so many others have their custom homegrown reflection scheme and there are a thousand libs on GitHub trying to reimplement it: https://github.com/topics/reflection?l=c%2B%2B

It's exactly like type systems being Turing complete : if yours isn't, someone somewhere will be making a language that compiles down to yours with one because of how useful of a property it can be in some cases

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by tasubotadas on Wednesday October 05, 2022 @04:25AM (#33092752)
I am sorry to hear that you have experienced such a sorry bunch of code-bases and frameworks but that doesn't define the language or even an ecosystem.

I've seen worse magic crap happening with Ruby and Python with their auto-magic method invocations.

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by tonyarkles on Wednesday October 05, 2022 @10:34AM (#33096086)
> but that doesn't define the language or even an ecosystem

I want to agree, but at least locally (as in geographically), these technologies seem to be heralded as fantastic. Maybe there's some kind of Spring Bubble around here, but on the main Maven site, Lombok shows up as the #16 most popular package (with primarily logging and language packages above it), and Spring isn't too far behind.

> Ruby and Python with their auto-magic method invocations

It's probably worth separating those two... as far as the functionality goes, Ruby and Python both have the capability of similar magic, but in my experience with popular frameworks, Ruby takes it to a whole other level while in Python it's generally discouraged.

I realize it's all anecdata here, but in my experience working with various companies and platforms, the Ruby magic generally just lives behind the scenes and Just Works. The Java magic would often turn into runtime exceptions, and the people who tried to do Ruby-like magic in Python would have similar difficulties. All of that revolved, primarily, around the ecosystems around the languages.

Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by eloff on Tuesday October 04, 2022 @06:30PM (#33088006)
In theory Java is not so bad. I just have never enjoyed working with it or with the code Java developers end up creating. Kotlin is reasonably pleasant. I've sometimes used it when the JVM was a hard requirement.
Re:C++20 coroutines: “The bug is in the C++ standard, not GC... by marginalia_nu on Tuesday October 04, 2022 @06:35PM (#33088061)
Java is like one of those ice berg memes with a lot of byzantine JVM shit lurking at the depths.