The one who often gets lost in variable naming

Personal variable naming

I want to add more and more in the future. Comments are also reflected ⭐︎

Plural form

variable Commentary
index index(i, idx)
indexes Array of indexes(ids)
articles Array of articles
article_id Article ID
article_ids Array of article IDs, article_id + s
articles_id ID that summarizes several articles
function verb
get_article Get one article
get_articles Get multiple articles

Frequently used words

function Commentary
get_〇〇 Get
calculate_〇〇 Calculate
generate_〇〇 Generate
display_〇〇 To display
format_〇〇 Shape
fetch_〇〇 Get
import_〇〇 Import
convert_〇〇 Convert
complement_〇〇 Complement
save_〇〇 Save
show_〇〇 To display

Boolean

Boolean
created_article Was the article created or not
is_method〇〇_enabled Is the method effective or not

Recommended Posts

The one who often gets lost in variable naming
I got lost in the maze
The one who is not on DVD
The one that displays the progress bar in Python
The guy who gets fitbit data from the server