Naming Conventions Reading
Decode camelCase, snake_case, boolean prefixes, abbreviations, and intent from variable names
Naming signals
- is/has/can/should prefix → boolean
- Abbreviations: cfg (config), req (request), res (response), ctx (context), err (error)
- _name (leading underscore) → private convention or older style
- SCREAMING_SNAKE → constant that never changes
- handle + Event → event handler function
- i, j, n in short loops → acceptable short names
Question 0 of 5
What does the variable name isAuthenticated tell you about its type and meaning?
A boolean indicating whether the user is authenticated. The prefix
is is a strong naming convention signal: - is / was / has / can / should / will prefixes → almost always boolean
isLoading→ booleanhasPermission→ booleancanEdit→ booleanshouldRetry→ boolean
Decode this variable name from a Python codebase: usr_cfg_dict. What does it likely represent?
A dictionary containing user configuration settings. Decoding snake_case abbreviations:
usr→ usercfg→ configuration (extremely common abbreviation)dict→ dictionary (Python data structure — also used as a type suffix)
cfg (config), env (environment), req (request), res (response), ctx (context), tx / trx (transaction), btn (button), msg (message), err (error), val (value), idx (index).A TypeScript class has: private readonly _connectionPool: Pool. What do the underscore prefix and readonly tell you?
Underscore prefix = private convention; readonly = cannot be reassigned after construction. Naming convention signals:
- _name (leading underscore) — private/internal by convention (Python) or older JS/TS style before the
privatekeyword existed. Still seen in legacy code. - readonly (TypeScript) — the property can be set in the constructor but never reassigned after. Equivalent to Java's
final. - SCREAMING_SNAKE_CASE — constants that never change:
MAX_RETRY_COUNT,API_BASE_URL - PascalCase — classes, types, interfaces, enums (most languages)
What naming pattern does handleSubmitFormClick suggest about this function's context?
An event handler triggered by a form submit button click. Event handler naming patterns:
- handle + [target] + [event] — e.g.,
handleSubmitClick,handleInputChange,handleModalClose - on + [event] — e.g.,
onClick,onChange,onSubmit— typically prop names in React - The name reads from outer to inner: handle → the action (Submit) → the element (Form) → the event type (Click)
event.preventDefault() if needed.You see a Go variable named n inside a for loop. What is the accepted interpretation?
A short loop counter or size variable — acceptable for short-scope variables. Short variable naming conventions:
- i, j, k — loop indices (universally accepted)
- n — count or size (e.g.,
n := len(slice)) - x, y — coordinates or generic values in math-adjacent code
- v — value in range loops (Go:
for _, v := range items) - err — error return in Go (by strong convention:
if err != nil)