How to name variables and functions in JavaScript

preview_player
Показать описание

In this video, senior developer Michael talks us through his advice on deciding names in a code base.

We look at how to decide a variable name, best practice for naming functions, and, perhaps most importantly of all, whether it is wrong to call a button 'btn'.

💻 Contents: 💻
00:40 - How to name a variable
03:28 - Variable names should scream intent
03:48 - When naming goes wrong
04:18 - How to name functions
04:50 - Casing on verb names
05:34 - is doDodoDonation() a good function name?
06:34 - Naming things intuitively
07:19 - When code naming goes wrong
09:11 - Is it wrong to call buttons ‘btn’?

📺 Full interview here:

💻 Check out Scrimba’s interactive learning platform:

🌲 Linktree:
Рекомендации по теме
Комментарии
Автор

3:57 The time I was in the stream I thought of disc_user and scrim_user. Naming things a whole might be more helpful than I thought, thanks for the tips Michael!

RockerStarrr
Автор

I appreciate the elephant in the video

DaveCollison