Skip to content

Instantly share code, notes, and snippets.

@blundell
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blundell/9830707 to your computer and use it in GitHub Desktop.
Save blundell/9830707 to your computer and use it in GitHub Desktop.
This is an example of possible code when you have a maximum line length of 150 to attain max readability
// Code readability - 4 possibilities
// A
context.getContentResolver().update(getDownloadUri(context, intent), values, null, null);
// vs
// B
context.getContentResolver().update(
getDownloadUri(context, intent), values, null, null);
// vs
// C
Uri downloadUri = getDownloadUri(context, intent);
context.getContentResolver().update(downloadUri, values, null, null);
// vs
// D
ContentResolver resolver = context.getContentResolver();
Uri downloadUri = getDownloadUri(context, intent);
resolver.update(downloadUri, values, null, null);
@Dorvaryn
Copy link

What about E ?

context.getContentResolver()
       .update(getDownloadUri(context, intent), values, null, null);

@xrigau
Copy link

xrigau commented Mar 28, 2014

I like A, then C, then D

@blundell
Copy link
Author

D is where I would like to end up if separating concerns and injecting dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment