hyperoslo / android-playbook

MIT License
6 stars 2 forks source link

data classes #27

Closed jeantuffier closed 7 years ago

jeantuffier commented 8 years ago

What do you think about the formatting for data classes ? Which one do you prefer ?

data class ProductColorBlock(val title: String, val description: String, val products: Array<Product>,
                                                val colors: Array<String>, val link: String)

vs

data class ProductColorBlock(
        val title: String, 
        val description: String, 
        val products: Array<Product>,
        val colors: Array<String>, 
        val link: String
)
jeantuffier commented 8 years ago

I prefer the second one, I think It's a lot more easy to read

sindrenm commented 8 years ago

Definitely the last one. But in the case of smaller data classes with less properties inlining is fine:

data class Point(val x: Int, val y: Int)
jeantuffier commented 8 years ago

Agreed then :) but let's wait a little bit for other comments before putting this as a rule in the README file

sindrenm commented 7 years ago

I think we've waited long enough, @jeantuffier. I'll make a PR. :+1: