Ask HN: Good ideas for naming functions

1 points by aliencat ↗ HN
I've came across the extra vocabularies such as `?`(return boolean) and `!`(destructive) for naming functions and variables. IMO they are much better more intuitive than names such as `is_...`, and I can't think of a good way to name destructive functions in language such as Python, C, java.

Is there a good convention/idea to name your functions wisely that are less verbose and straight to the point?

1 comment

[ 3.0 ms ] story [ 10.9 ms ] thread
Some languages use mathematical symbols to name functions that are derived from mathematical rules/principles (e.g. the Scalaz library). I think it's a good idea. If you're implementing function composition, just use the mathematical symbol for composition, don't pull a new name out of a hat.

A lot of people complain about it, the main reasons being:

- it's annoying to type - a lot of developers actually don't have a math background and have no idea what the symbols mean