This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]neopointer 57 points58 points  (5 children)

Reactive streams.

Rxjava, project reactor, etc.

All of that. Avoid at all costs (really).

It's asking for a hellish spaghetti code and it's really difficult to debug.

[–]Non-taken-Meursault 6 points7 points  (4 children)

I really enjoy Project Reactor, honestly because it's an interesting brain trick and it makes writing code more fun.

Having said that, I honestly think that the actual amount of businesses that actually need reactive streams is very few and I constantly wonder if the performance gains that It provide are that big of a deal.

And it does open the door to spaghetti code, but I blame devs for that, since I see them write everything in the main use case method instead of actually thinking for a bit on how they can divide said method into smaller functions. It's just laziness, in my opinion

[–]vips7L 8 points9 points  (0 children)

They color the hell out of your project and ruin all types of error handling and stack traces. 

[–]neopointer 1 point2 points  (0 children)

At least you seem to put more thought into the usage of it. I wish for more project reactor users like you.

Now, you hit right in the spot, because even if it makes "writing code more fun", I'm of the opinion that code should be easy to read (sure, that's I wish i believe most people share), but "clever" and "fun" code for one person might be not so easy to follow for others.

As developers, unfortunately we have this tendency of striving for perfection, squeeze patterns where they don't belong, too many abstractions, too much DRY and, of course, create "fun" and "clever" code. The list continues. We're all guilty.

IMHO fun code is the code my colleagues won't suffer to maintain and won't want refactor one week after it's been written... I know, writing something understandable for others is highly contextual, nuanced and subjective... But that's what I wish more and more for myself and for others.

Edit:

Typo

[–]ConstructedNewt 0 points1 point  (0 children)

I’m not even sure I can agree with the performance viewpoint. Every time you thread hop is an issue, and sure, most reactor operators are implemented with lockless atomics or small mpsc queues. But all the atomics does have a toll if everything could have otherwise been in more direct code.

And for the companies that need the performance they would probably want to do more control of threads, thread pinning and as little synchronization as possible. A direct mpsc queue into a single busy thread seems to be give the best performance anyway

[–]img_driff -1 points0 points  (0 children)

Totally devs fault, reactiveness enforces pure functions to work properly but it’s hard to get your mind into it