The Simplest RxJava Observable Sample App
Adam Hurwitz
354

  1. Why would you use Observables/FRP if you are just using toBlocking().single()
  2. RxJava is built around the idea of functional programming, which tries to push ‘pure’ functions and immutable data. Your ‘transform’ function is very bad practice how it changes and returns the same object, it should return a new object with a different value
  3. Why did you create the ‘Object’ class? You could have just used Boolean? (Since you are only concerned with true/false).
  4. The chain is performed twice every time you flick the switch just because you want to log the output. You should store the result in a variable maybe?
  5. You repeat code everywhere (I know this is a sample but it’s like against every programmers nature to repeat the stuff you have)

Of course the example needs to be simple and easy to understand, but you just don’t seem have a clue about the benefits of functional reactive programming.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.