Closed teszes closed 3 years ago
Regarding the two points:
It's not redundant, as it signals to new users what words can be changed and what can't.
There are other ways to solve the second problem, if it becomes one.
I don't think this is worth spending so much time on.
I would add some more explanation to README – for future contributors. Would the following work?
All names that can be change by the user (resources, variables, data items) should be prefixed with "changeme_".
All names should be unique across all examples (resources, variables, data items).
I would like to reopen the discussion on the naming conventions that we have.
As I understand, the current convention is the following:
I think this has two issues:
Consider the same situation, if the language in question was not Terraform, but Python:
You could say that there are a few issues with this snippet:
Compare this with a TF snippet from out repo:
This also implies that the thing to change here is the resource name. However, the machine size and the AMI are arguably more important in this context. There is also little documentation to learn what the value of an AMI could be.
To refactor the Python example before, this would be IMO a correct approach:
As it explains every variable that can be changed, and also indicates the intention around using them. It also resolves a "magic numbers" code smell.
Conversely, the TF snippet could be changed in the following way:
This way we could extend documentation to variables as well, and also display all variables that can be changed.