Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cognitive load is what matters [Programming] (minds.md)
4 points by prollyjethi on Dec 21, 2024 | hide | past | favorite | 1 comment


I think the effects of cognitive load on code readability can be demonstrated with variable and function names:

  phi
  s
  ses
  session
  cursor_session
  database_session
  dbs
  db.session
Really short variable names reduce the cognitive burden for users that understand that "phi" means "database session", but frustrate users who aren't contextually familiar.

Really long variable names make it too difficult to verbalize and thus comprehend code.

Is 7±2 a practical limit to working memory for seasoned coders, though?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: