Naming conventions for key/value storage

598 views
Skip to first unread message

Sam Sen

unread,
Oct 10, 2016, 3:30:23 PM10/10/16
to Consul
Underscores, hyphens, periods? What should I avoid? It seems I can use any of those three characters but wasn't sure if I should stick to one format.

Lowe Schmidt

unread,
Oct 11, 2016, 4:08:38 AM10/11/16
to consu...@googlegroups.com
Sticking to one format is certainly smart, I would personally avoid periods because they are sometimes used as separators (more so than underscores and hyphens).



--
Lowe Schmidt | +46 723 867 157

On 10 October 2016 at 21:30, Sam Sen <samna...@gmail.com> wrote:
Underscores, hyphens, periods? What should I avoid? It seems I can use any of those three characters but wasn't sure if I should stick to one format.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/1ff77521-d499-443c-8e06-26942723769e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Adams

unread,
Oct 11, 2016, 9:04:51 AM10/11/16
to consu...@googlegroups.com
Hyphens feels most natural to me in this context, but I don't have any logical justification for that. Underscores is probably the most friendly in terms of being easily converted to identifiers in other contexts, eg variable names which in most languages do not allow hyphens or periods. I don't think there are any magical wins or losses to any particular approach, though. Tools like envconsul that set environment variables from key names convert invalid characters to underscores automatically.

On Mon, Oct 10, 2016 at 2:30 PM, Sam Sen <samna...@gmail.com> wrote:
Underscores, hyphens, periods? What should I avoid? It seems I can use any of those three characters but wasn't sure if I should stick to one format.

--

Sam Sen

unread,
Oct 20, 2016, 8:46:45 PM10/20/16
to Consul
Good to know. I'm going to stick with underscores since I can use it across different languages (python, bash, etc...)


On Tuesday, October 11, 2016 at 9:04:51 AM UTC-4, David Adams wrote:
Hyphens feels most natural to me in this context, but I don't have any logical justification for that. Underscores is probably the most friendly in terms of being easily converted to identifiers in other contexts, eg variable names which in most languages do not allow hyphens or periods. I don't think there are any magical wins or losses to any particular approach, though. Tools like envconsul that set environment variables from key names convert invalid characters to underscores automatically.
On Mon, Oct 10, 2016 at 2:30 PM, Sam Sen <samna...@gmail.com> wrote:
Underscores, hyphens, periods? What should I avoid? It seems I can use any of those three characters but wasn't sure if I should stick to one format.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages