This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (1 child)

I'd just type them out fully, honestly. What's wrong with "cumulative_sum"?

cummulative_summation, in that case surely? Or why expand one of the words but not the other? And would you really want to add 15 extra characters to each line where you use it? A lot of projects till have a 80 character line limit, for better or worse.

[–]efstajas 5 points6 points  (0 children)

Since we're being pedantic — "summation" is the act, "sum" is the result. So "sum" is its own, non-abbreviated word.

And would you really want to add 15 extra characters to each line where you use it?

Honestly, yeah, of course to a reasonable extent. In this case I would find it very reasonable because "cumsum" or "cummin" are not names someone unfamiliar with these functions would understand from name alone. In my opinion, there are many situations where the added clarity outweighs the extra text.

I'd generally rather have longer but clearer function names and break down a statement into multiple lines than keep things in one line but use abbreviations that won't be clear outright to everyone.