anordal / shellharden

The corrective bash syntax highlighter
Mozilla Public License 2.0
4.63k stars 130 forks source link

Rewrite examples in `printf` wherever possible? #26

Closed gsklee closed 5 years ago

gsklee commented 5 years ago

@anordal In echo → printf, the guide is trying to make a case that printf should be preferred over echo; however in a lot of other places within the guide (eg. Corollary: Use while loops to iterate strings and command output), echo is being used extensively. Do we want to consolidate the guide and rewrite examples in printf wherever possible?

gsklee commented 5 years ago

@anordal Any explanations?

anordal commented 5 years ago

It should always be possible to replace echo with printf. I only rewrote the guide's examples in printf where necessary according to itself – I admit it was inconsistent. I also tried to de-emphasize the hysteria and focus on the why part (5f425ee47).

Are you wondering why I didn't change the rest?

In the cases where it doesn't matter, I have two concerns:

gsklee commented 5 years ago

Thanks for the detailed explanation 👍