Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15853 > unrolled thread

Re: Preventing Bash Variable Confusion

Started bykonsolebox <konsolebox@gmail.com>
First post2020-01-30 16:19 +0800
Last post2020-01-30 16:19 +0800
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Preventing Bash Variable Confusion konsolebox <konsolebox@gmail.com> - 2020-01-30 16:19 +0800

#15853 — Re: Preventing Bash Variable Confusion

Fromkonsolebox <konsolebox@gmail.com>
Date2020-01-30 16:19 +0800
SubjectRe: Preventing Bash Variable Confusion
Message-ID<mailman.93.1580372436.2384.bug-bash@gnu.org>
On Thu, Jan 30, 2020 at 2:40 PM Roger <rogerx.oss@gmail.com> wrote:
> 1) Using an underslash on all capitol variable names just looks ugly in my
> opinion.

If you mean adding an underscore prefix I agree.

> 2) Prefixing variable names with the name of the script (or other lengthy
> prefix) requires more characters I could be using for describing my variable or
> function.  (If I were writing unreadable code, I probably would not mind.)

Really just useful if you're writing in multiple scripts.

> I've decided to comply with Google's Style guidelines, even though they do not
> pay me a paycheck, but they do give me lots of free stuff.  Shrugs, besides,
> the more my Bash scripting looks like C, the easier it is to read.
>
> The can push me away from defining my variables in all capitol letters.  They
> can even push me to code in C and Assembly, but just don't push me to script in
> Python.

They still allow you to define constants in all-caps.  The impact it
makes is not so different with defining globals as such.  Try Ruby.

-- 
konsolebox

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web