Sign in
Log inSign up

Do you prefix private methods with underscore (_)?

Emil Moe's photo
Emil Moe
·Aug 7, 2016

I remember that in especially C and maybe C++ it's common to underscore private methods, so their name would be (pseudo code)

class Foo {
  private _bar() {
    // Do Nothing
  }
}

Do you follow this practice and what do you think about the practice in especially PHP?