Member-only story

Immediately stop using responsive programming and understand his original sin in one article

Beck Moulton
10 min readJun 25, 2024

--

I don’t quite understand why more and more projects use reactive programming frameworks under the banner of high performance, and then mess up the code. Is reactive programming really that good? Or is it “ The world has suffered from reactive programming for a long time “, persecuting the flowers of our motherland? In my opinion, reactive programming has committed at least three sins: 1. Easy to cause complexity; 2. Difficult to debug; 3. Performance fog. In view of this, I hope that my colleagues in development can choose a programming paradigm that is really suitable for themselves and their team.

Crime 1: Easy to cause complexity

The code of reactive programming is usually more complex than traditional imperative programming. Essentially, it encapsulates callbacks and needs to convert step-by-step operations into callbacks one by one. Because the bottom layer adopts the observer pattern, we need to register all business operations in Publisher and then receive data flow through notification mode. In order to play the role of asynchronous programming, this chain cannot be broken, which makes it easy for developers to write code with many points, points, points, points…, poor readability and error-prone. As shown below, this is a real project code example.

private Mono<HyperClusterSwitch> ensureSwitchConfigured(String parentJobId, HyperClusterPort port) {
String switchIp =…

--

--

Beck Moulton
Beck Moulton

Written by Beck Moulton

Focus on the back-end field, do actual combat technology sharing Buy me a Coffee if You Appreciate My Hard Work https://www.buymeacoffee.com/BeckMoulton

Responses (7)