Should we use name conventions for Signals

We discuss various naming conventions for Signals in Angular, weighing the pros and cons of each and offering recommendations based on project contexts..

Should we use name conventions for Signals

users$

Every Angular developer knows instantly that users$ is an Observable. The dollar suffix has established itself as a suffix for observable streams.

Signals have been out for a year now, and there is currently no established naming convention for them. I asked myself, why? So, I asked different developers which conventions they use. Here is a list of what I found out so far

Possible Singal Convetions

users$ - Some folks use the same convention as for Observables. The reason is that they just want to know that this is not a plain value; it is either Observables or Signals.

users$$ - Double dollars for Signals? Not sure about that...

$users - This is one of the most commonly used conventions. People are used to dollars, so they put it in front of the variable.

usersSignal - Suffixing every Signal with “Signal” is an approach for those who prefer clear and long names instead of short and ambiguous names.

usersS - For the lazier guys. I find it hard to read, especially if your variable ends with an “s.”

users - The most used convention, which I could determine, is - no convention at all. To be honest, I liked it the most. Since Angular is shifting completely to Signals and we are used to building fully reactive templates, the default binding of variables should be Signals. The highlighting of modern IDEs like Webstorm is completely sufficient for me. (I don’t know exactly about VSCode, but I assume some plugins do this very nicely as well).

Maybe someone is asking the question now: But if we don't use naming conventions for Signals, how can we distinguish a normal function call from a template with a Signal value? Yes, but I think it is totally fine since we should avoid function calls in templates.

Conclusion

If I start a project from the beginning, I will go without any suffixes/prefixes. However, if I start using Signals in an existing project, where I have Observables and plain values, I will go with the $users approach. Just to not mix things up and not confuse other developers.

What is your preferred way of using Signals?