<!--
title: Private variable naming convention
domain: ml-systems
topic: Naming Conventions
language: TypeScript
source: kubeflow/kubeflow
updated: 2023-03-24
url: https://awesomereviewers.com/reviewers/kubeflow-private-variable-naming-convention/
-->

Use the 'prv' prefix for private class members and ensure they're explicitly declared with the 'private' access modifier. This maintains consistency with established team conventions and improves code readability by clearly indicating variable scope.

```typescript
export class MyComponent {
  // Correct: prefix matches access modifier
  private prvUserData: UserData;
  
  // Incorrect: prefix doesn't match access modifier
  public prvConfig: Config;
  
  // Incorrect: no prefix but is private
  private userData: UserData;
}
```

When refactoring existing code, update variable declarations to follow this pattern consistently. For observable patterns, public-facing properties should have clean names without implementation details while their corresponding subjects should use the 'prv' prefix:

```typescript
export class MyService {
  // Private subjects
  private prvDataSubject = new ReplaySubject<Data>(1);
  
  // Public observable (clean naming)
  data = this.prvDataSubject.asObservable();
}
```
