addLabelAndValue…ForDropdownToFunction is too descriptive of the “what”. Plus, it’s assumed that adding labels and values is required for a dropdown to function. It should be changed to say the “why” (ie, we are creating required metadata for a dropdown)
“To Each” is generally understood if operating on an array type, “Map” is better if it needs to be specified
filterAndSort is generally presumed to happen when you are getting by a filter and returning a copy of the results (if it is mutating and returning, that is a sign that something bad is happening)
“As per” does not clarify anything compared to using “by” or “with”
26
u/droomph May 13 '22
How did I do
31
u/ehosca May 14 '22
There are only two hard things in Computer Science: cache invalidation and naming things.
-- Phil Karlton
19
u/MurdoMaclachlan public boolean isInt(int i) { return true; } May 13 '22
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
5
u/putin_vor May 14 '22
This is what people call self-documenting code. I prefer to write lengthy comments explaining things.
1
u/Ambitious_Ad8841 May 21 '22
\n
1
u/NullParadigm May 28 '22
Sometimes laziness turns into just long writing, i.e to lazy to describe it better, so just go with something safe.
1
u/[deleted] Dec 23 '22
definitely js
0
u/[deleted] May 14 '22
It is code.
0
u/[deleted] Jun 15 '22
[deleted] — view deleted comment