Tam H. Doan
1 min readNov 10, 2019

--

Based on your article, Android framework also have bad code:

  • “A function should either do something or return something — but not both”: Android do this with boolean onTouch (View v,
    MotionEvent event)
  • “Never pass flag arguments: Passing flag (true/false) as an argument is truly a terrible practice”: Android also do this with setEnabled(boolean visible),..

In the second example, I agree that we should follow SRP, but this approach sometimes cause duplicated code.

So it’s hard to say which is the right way for a function to be implemented…

--

--

Tam H. Doan
Tam H. Doan

Written by Tam H. Doan

Software Engineer, also a Writer and Runner

No responses yet