Given an array of similar hosts, what are some of the advantages and disadvantages of zero padding or not?
Zero Padding
www-01
www-02
...
www-11
www-12
No Padding
www-1
www-2
...
www-11
www-12
I've seen both in practice and have heard reasons for/against each. The only snippet I've come across referencing zero padding is a small note in the Debian addclients manpage, but no reasoning: "Padding hostnames with zeros is not recommended." Does anyone know what background or justification might be behind this recommendation?
Pros
- Simple alphanumeric sorting
- Fixed width
Cons
- Breaks down after the maximum padded id (99, 999, ...)
- Adds slight complexity to any comparison/validation (
^\w+-\d{<id_length>}$
vs^\w+-\d+$
)