Mono.just(“Penetrating system”) .doOnNext(System.out::println) .delayElement(Duration.ofSeconds(1)) .flatMapMany(() -> Flux.just(“20%”, “40%”, “60%”, “80%”, “100%”)) .map(“Hacking NASA %s”::format) .doOnNext(System.out::println) .delayElement(Duration.ofSeconds(1)) .subscribe();
Better?
I might be in a minority of this, but using numbers that way breaks my flow for 2 reasons: Firstly, any number of lines greater than around 3 or 4 means I have to stop and manually count. Not that counting to 6 takes a long time, but it does use some mental capacity while I want my mind focused on the actual code. Secondly, I don’t have touch typing in my fingers for the number line on my keyboard. If I need to type a number, I either have to look down at my keyboard, or move my hand over to the numpad. In both cases it would be quicker for me to
Vjjjjjy
.