Menu
ComponentKit LogoComponentKit
DocsInfrastructureAPIGitHub
ComponentKit LogoComponentKit
  • Docs
  • Infrastructure
  • API
  • GitHub
  • Getting Started
    • Getting Started
    • Philosophy
    • Uses
  • Reference
    • Component API
    • Composite Components
    • Views
    • Responder Chain
    • Actions
    • State
    • Scopes
    • Component Controllers
    • Lifecycle Methods
    • Debugging
  • Animations
    • General Principles
    • Initial / Final Animations
    • Change Animations
    • Legacy APIs
  • Collection Views
    • Overview
    • Basics
    • Changeset API
    • Gotchas
    • Dive Deeper
  • Best Practices
    • Never Subclass Components
    • Avoid Overrides
    • Indentation
    • Avoid Local Variables, Use Const
    • Avoid Single Use Constants
    • No Underscores
    • Pass in Actions
    • No Side Effects
    • Pass in Immutable Objects
    • Components Can't Be Delegates Directly
    • Avoid Excessive Branching
    • Check for Nil
    • Avoid push_back
    • Under 300 Lines
    • Avoid Width 100%
    • Use Designated Initializer Style
    • Break Out Composite Components
    • Keep Controller in Component
  • Appendix
    • Why C++
    • Advanced Views
    • Component Context

No Underscores

Don't underscore-prefix private helper methods or static C functions.

- (void)_buttonAction:(CKComponent *)sender
{
_logEvent(@"button tapped");
}

Subclassing components is discouraged, so there's no need to worry about distinguishing public and private methods or colliding with methods in the superclass.

- (void)buttonAction:(CKComponent *)sender
{
logEvent(@"button tapped");
}
Previous
« Avoid Single Use Constants
Next
Pass in Actions »
Facebook Open Source Logo
Copyright © 2021 Facebook, Inc.