Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Learn something new every day.
- I am a senior software engineer working in industry, teaching and writing on software design, SOLID principles, DDD and TDD.
Location
Buenos Aires
Education
Computer Science Degree at Universidad de Buenos Aires
Yes, but the way you’re using the terms “declarative and imperative” is not aligned with the computer science definitions of those words.
Imperative code tells the computer to do something. “Reduce over this list of orders by summing their cost”
Declarative states an axiom or truth. “This value is the result of applying a fold right operation using the function
aonx”you are right.
I am abusing the concept.
It is declarative code with bad names
I don't agree because it should never be set on stone.
"Max" is pretty descriptive even if you don't use "maximum", inside that scope it's ok. Wouldn't be true if "m" were used.
However, in this example:
I would say one letter is the correct choice, since:
Having no abbreviations actually hurt how to read and generate just extra clutter.
My rule of thumb is to have the name length inversely proportional to the scope.
A dozens of lines function calls for bigger, descriptive names.
A one liner? Maybe one letter is enough.
'My rule of thumb is to have the name length inversely proportional to the scope'
It is fine.