Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ? in predicate function name, use ! in side-effect function name #34

Closed
kawas44 opened this issue Jan 12, 2013 · 3 comments
Closed

Comments

@kawas44
Copy link

kawas44 commented Jan 12, 2013

Advise on function naming

Use ? at the end of predicate function name to visually hint users.
ex: nil? and empty?

use ! at the end of side-effect function name to visually hint users
ex: pop! and assoc!

@bbatsov
Copy link
Owner

bbatsov commented Jan 12, 2013

There is already advice on that subject in the Naming section.

@halgari
Copy link

halgari commented Jan 14, 2013

And to be clear, in clojure ! means that it's not STM safe (as the guide currently states), not that it's side-effect free. Notice that send and send-off have side-effects, but are STM safe, hence the lack of !

@bbatsov
Copy link
Owner

bbatsov commented Jan 14, 2013

@halgari is absolutely right.

@bbatsov bbatsov closed this as completed Jan 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants