Skip to content

Update Styleguide #98

Description

@bastelfreak

I would like to propose a change to our styleguide. We currently have a lot of functions with var checking like this:

function foobar {
  if [ -n "$1" ]; then
    # some magic
  fi
}

I would like to move it to a oneliner:

E_NOTENOUGHPARAMS = 4561
function foobar {
  [ -n "$1" ] || return "$E_NOTENOUGHPARAMS"
  # some magic
}

this would save up one level of indentation. @killermoehre or @dhxgit any opinions on this one?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions