Prefix suffix with or without space

I’m not sure where to group this. But when making scripts that add prefix or suffix to naming things. Do you get the user to add a space before or after and give them a hint to do that. Or do you add it in for them in the script. But by chance if there was a dot to start the suffix this would cause an issue… Have I answered my own question? :thinking: Curious if anyone else has thoughts on this or am I over thinking it

1 Like

Depends on how rigid the standards are. Generally I’d get the user to include the prefix separator in the prefix for flexibility.

2 Likes

Yes. If you’re really concerned trigger a pop up that shows the result (ie: {parameterVaueHere}.SuffixHere) and allows the user to cancel or send the value(s).

2 Likes

I would let the user use a separator, but I would probably have a dummy value in place for the suffix so the user can see what kind of formatting is preferred (you might want an underscore instead of a space).
About dots and forbidden characters in the context of Dynamo you might check if the input contains such a character and show an error message instead of continuing with the script.
In the context of an app you can have a function that only allows certain charactes as input.

You haven’t given any specifics on whether this is a standardized naming convention or a flexible one. So it kinda depends.

In my experience, when dealing with standardized naming conventions that include a prefix and/or suffix, the separator is not part of the prefix/suffix. If the naming convention is already set and the separator is known, then the user should not be including it at all. If the naming convention is flexible and a specific separator can be provided, then it should be provided separately from the prefix/suffix.

As a side note, you can always include a check for duplicated separators to make sure users aren’t defining inputs improperly if you’re worried about that happening. But well defined inputs will always be better. @viktor_kuzev also makes a good point of using a placeholder or default value to prevent any issues there as well.