Skip to content

Development Decisions

inshiro edited this page Mar 23, 2019 · 9 revisions

Why Kotlin?

It runs natively on Android and using it is more fun and time efficient.

Why use Fragments?

Because they are supported, maintained, and recommended officially by Google. They're modular pieces of code you could insert or remove anywhere. The single activity and multi-fragment architecture works well together, in my opinion, much better than multi-activity or single activity and custom views approach.

Why not use the Navigation library?

I did. But it currently doesn't retain fragments and I wanted more flexibility for mine. So I went ahead and made my own that handles everything much more easier and more reliably.

Why use RecyclerView instead of NestedScrollView with TextView?

For very large text, the NSV approach would take a while to initially load. Although it would be a good solution for tablets and for a reader mode-esque style (due to the same-line text alignment), I couldn't have both because that would require both implementations of all text modifying features, which means double the work. See this talk on text. RecyclerView saves memory by re-using views and loads almost instantly in comparison the former approach.

Why be frugal with libraries?

  • Reduce complexity
  • Reduce learning curves for everyone
  • Reduce dependencies
  • Reduce app size
  • Reduce external bugs
  • Prioritize relevance and avoid external discontinuations

Why use Dependency Injection?

  • Abstraction and delegation
  • Cleaner code
  • Makes everything easier
  • It sounds cool and using it makes you feel like a boss

Why not use RxJava?

See Why be frugal with libraries

Clone this wiki locally