News for hackers. Stuff that matters.
Re:I've been merging microservices back into the monolith by burade on Monday December 21, 2020 @02:31PM (#25498465)
People are godamn hopeless.

I just saw a guy trying to argue that writing functional-style Java is the "new" way to write Java, and that not using functional interfaces means you're writing "old" style code.

Re:I've been merging microservices back into the monolith by lmm on Tuesday December 22, 2020 @04:07AM (#25504401)
> I just saw a guy trying to argue that writing functional-style Java is the "new" way to write Java, and that not using functional interfaces means you're writing "old" style code.

Sounds right to me. (Of course not having first-class functions was just as bad 20 years ago, but fewer people had realised it back then).

Re:I've been merging microservices back into the monolith by akmarinov on Monday December 21, 2020 @02:57PM (#25498820)
I don’t know about Java, but we’re seeing a shift to functional in the mobile space, where non functional code is definitely “old” code. In Swift with Combine and in Kotlin with their thing.
Re:I've been merging microservices back into the monolith by burade on Monday December 21, 2020 @03:17PM (#25499070)
"Old" in what sense though? In the style/fashion sense?
Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:46PM (#25500602)
> "Old" in what sense though? In the style/fashion sense?

If you take the time to look into it, you'll discover that the functional style is only a change in the "fashion sense" to those who are totally oblivious to their advantages.

I get how the pedantic take on monads turns people away from the functional side of programming, but you'd be hard pressed to find anything to criticize how returning either/result monads from promises is not a huge improvement over the boilerplate-rich/pure OO approach to Java.

Re:I've been merging microservices back into the monolith by akmarinov on Monday December 21, 2020 @03:26PM (#25499170)
In the “writing non-functional code in 2 years will be the same as writing Objective-C today” sense.
Re:I've been merging microservices back into the monolith by Animats on Monday December 21, 2020 @03:29PM (#25499190)
I feel guilty when I write a FOR statement in Rust.
Re:I've been merging microservices back into the monolith by Spartan-S63 on Monday December 21, 2020 @04:39PM (#25499915)
Me too. Mostly because it’s a smell to me that I’m mutating some internal state. I try to avoid that as much as possible because it quickly becomes soup.
Re:I've been merging microservices back into the monolith by refactor_master on Monday December 21, 2020 @05:21PM (#25500332)
I feel guilty when my C# method isn’t immediately returning a LINQ expression.
Re:I've been merging microservices back into the monolith by ConcernedCoder on Monday December 21, 2020 @06:02PM (#25500762)
The contortions I see used day-to-day to write code in the latest/greatest pardigm du-jour is criminal... I routinely have to revisit "functional masterpieces" of "easy to grok" code, and completely re-write to minimize CPU and/or memory consumption.
Re:I've been merging microservices back into the monolith by coding123 on Monday December 21, 2020 @04:13PM (#25499620)
People are still using Java?
Re:I've been merging microservices back into the monolith by cmdshiftf4 on Monday December 21, 2020 @04:48PM (#25500021)
>People are still using Java?

C'mon, you've been around here long enough to know better than to be making such comments

https://insights.stackoverflow.com/survey/2020#most-popular-...

https://octoverse.github.com/

Re:I've been merging microservices back into the monolith by maya24 on Monday December 21, 2020 @04:33PM (#25499855)
Yes Java is uqititous and it's not going away for 30 years at least. See Cobol. Java also has had significant improvements in the language so that there is less incentive to use other JVM languages like kotlin and it's fully interoperable with heartland code bases as far as I know
Re:I've been merging microservices back into the monolith by gnat on Tuesday December 22, 2020 @02:51AM (#25503994)
Forgive my ignorance: what's a "heartland" code base?
Re:I've been merging microservices back into the monolith by imtringued on Monday December 21, 2020 @05:19PM (#25500317)
The number of flaws that make Java inferior to other JVM languages is surprisingly small. By far the worst parts are excessively verbose "Beans", nullpointer by default, the JEE ecosystem (there are good alternatives) and the high RAM consumption (a JVM flaw). Honestly 80% of the value I derive from using a different JVM language come from avoiding NPEs, getters and setters. The remaining 20% can be very useful but they are certainly not essential nor can they be considered mandatory.
Re:I've been merging microservices back into the monolith by eitland on Monday December 21, 2020 @05:00PM (#25500132)
Whenever possible, yes.

Sane language. Fantastic tooling. Huge ecosystem. Backwards and forwards compatible like few other things.

Re:I've been merging microservices back into the monolith by rualca on Monday December 21, 2020 @05:48PM (#25500623)
> People are still using Java?

Yes, pretty much the whole world is using Java. Some FAANGs use it as basically their default software stack, and at most have introduced some Kotlin along the way.

The world doesn't revolve around flavor of the month tech stacks.

Re:I've been merging microservices back into the monolith by onethought on Tuesday December 22, 2020 @06:54AM (#25505391)
It revolves around JavaScript I think. ;p
Re:I've been merging microservices back into the monolith by rualca on Tuesday December 22, 2020 @07:36AM (#25505650)
Javascript in the browser, Java everywhere else.
Re:I've been merging microservices back into the monolith by onethought on Tuesday December 22, 2020 @02:10PM (#25509913)
Sure, if node didn’t exist, you’d be close to right.

If you check GitHub JavaScript and typescript are outstripping Java.

Re:I've been merging microservices back into the monolith by hackerfromthefu on Tuesday December 22, 2020 @08:54AM (#25506261)
Username checks out ..

Have you ever heard of search bubbles?

Re:I've been merging microservices back into the monolith by mumblemumble on Monday December 21, 2020 @04:05PM (#25499520)
That seems like an unnecessarily confrontational way to put it.

What I would say is that, from a 10km perspective, functional interfaces are just where the Interface Segregation Principle takes you when you really lean into it, and that dependency injection can be thought of as just a convenient way to do partial application in bulk, and that CQRS encourages you to create an ever-wider separation between your commands and your queries, and that, in general, once you get far along where clean object-oriented design wants to lead you, the whole functional vs OO debate often starts to feel like it's quibbling about syntax as much as anything else.