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?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct