5 habits when you should revisit your skills

1. You always rewrite the project from the scratch after receiving it from the other team

2. You always start searching a library, when you need to solve some problem

You trying to apply your habit patterns everywhere instead of tackling problems individually

Example 1:

@POST(«/»)
fun oneRpcMethod(args)

@POST(«/»)
fun secondRpcMethod(args)

Example 2:

view.setOnClickListener { presenter.onSaveClick() }

//presenter:
fun onSaveClick() = interactor.save(data)

//interactor
fun save(data: Data) = repository.save(data)

//repository
fun save(data: Data) = api.save(data)

4. You think that’s comments are redundant and code should be self-readable

/**
* Doing something
*/
fun doSomething()
/**
* Returns time in milliseconds
*/
fun currentTime(): Long
fun currentTimeMs(): Long
fun currentTimeMillis(): Long
fun currentTime(): Duration
spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
override fun getSpanSize(position: Int): Int {
//magic formula to be able to display things like
// ________________________________________________________
//| | | |
//| | Item 3 | |
//| Item 1 |__________________| Item 5 |
//| | | |
//|__________________| |__________________|
//| | Item 4 | |
//| Item 2 | | Item 6 |
//|__________________|__________________|__________________|
//
//with ratio 3:2 (bigger height to smaller height)
return SOMETHING_NEW_SPAN_COUNT / 2 + (position + 1) / 2 % 2
}
}

5. You commenting not working tests

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michael Spitsin

Michael Spitsin

650 Followers

Love being creative to solve some problems with an simple and elegant ways