Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_underscore as variable name prefix #10

Closed
icy opened this issue Jun 17, 2021 · 4 comments
Closed

_underscore as variable name prefix #10

icy opened this issue Jun 17, 2021 · 4 comments

Comments

@icy
Copy link
Owner

icy commented Jun 17, 2021

Though it's part of my coding style, sometimes I see it's very annoying. Yes I admit that :P in some long script I strictly follow the convention, but I also often break the rule.

https://github.com/icy/bash-coding-style#variable-names

Is that good to deprecate that one?

cc: @cuonglm @cmpitg (well, I hope you still have some .bash somewhere on your laptop :D)

@cuonglm
Copy link
Collaborator

cuonglm commented Jun 17, 2021

For me, it's a 👍 for deprecating this one.

The main purpose as describe in the style guide can be archived with ${this_is_a_variable}. That feels more natural and iconsistent with other guide like Google.

The only software that I notice so far, which use _ in variable name is https://developer.apple.com/library/archive/technotes/tn2228/_index.html#//apple_ref/doc/uid/DTS40007991-CH1-SUBSECTION15

@icy
Copy link
Owner Author

icy commented Jun 17, 2021

Thanks @cuonglm. Let me fix that. My new script would follow new style and I don't think I need to rewrite all past scripts.

Btw, there is some bash formatter :D

@icy
Copy link
Owner Author

icy commented Jul 2, 2021

I have a (tough) chance to look at some of my code I wrote 18 years ago. Now I know where my _ comes from. It's inspired by Python coding style https://docs.python.org/2/library/inspect.html =))

@icy
Copy link
Owner Author

icy commented Jul 2, 2021

I have a (tough) chance to look at some of my code I wrote 18 years ago. Now I know where my _ comes from. It's inspired by Python coding style https://docs.python.org/2/library/inspect.html =))

I learnt Python before I learnt Bash :D

@icy icy closed this as completed in d674864 Jul 7, 2021
icy added a commit that referenced this issue Jul 7, 2021
Fix #10: [Deprecation] Variable name started with underscore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants