alexanderepstein / Bash-Snippets

A collection of small bash scripts for heavy terminal users
MIT License
9.64k stars 842 forks source link

use unset #156

Closed retokromer closed 6 years ago

retokromer commented 6 years ago

Pull Request Label:

Pull Request Checklist:


alexanderepstein commented 6 years ago

Any reason you like the idea of unset at the top instead of the blank variable? I think even the blank variable was unnecessary but it just helped me remember to call getConfiguredClient when debugging

retokromer commented 6 years ago

Initialising empty variables with unset is considered good practice. Yet it’s mainly a matter of taste, I presume.

retokromer commented 6 years ago

P.S. – In other functions you do actually use unset, e.g. in currency.

alexanderepstein commented 6 years ago

I've used it before but only to set a variable to blank after it has been given a value I didn't think of doing it for the initial declaration of the variable

retokromer commented 6 years ago

Thank you, @alexanderepstein, for maintaining the Bash Snippets! I know many who use these.

alexanderepstein commented 6 years ago

No problem @retokromer ! I'll do my best to maintain these forever, I'm glad to hear that people like them and use them :+1: