Skip to content

Remove examples if-then-else pattern #618

Description

@mziccard

In bigquery example we have the following patttern:

Table table = getTable(...);
if (table == null) {
  // create table
} else {
  // load data
}

in storage we have:

Blob blob = getBlob(...);
if (blob == null) {
  // create blob
} else {
  // get and update blob's content
}

In both cases we should remove the else branch and rather execute it after table/blob creation.

Also in datastore we do:

Entity entity = getEntity(...);
if (entity = null) {
  // create entity
} else {
  // update entity access type
}

@ajkannan @aozarov @mderka Do you guys think we should remove the else branch also for datastore's example? It makes slightly less sense to me.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions