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

Variables naming convention #7

Open
lucielavickova opened this issue Aug 19, 2019 · 2 comments
Open

Variables naming convention #7

lucielavickova opened this issue Aug 19, 2019 · 2 comments

Comments

@lucielavickova
Copy link

lucielavickova commented Aug 19, 2019

Hello,

just as an improvement suggestion - from my own experience it's better to use underscores between words in variable names rather than spaces - it helps a lot (not only) during refactoring:

  • I can select the whole variable name by a double-click and see where it's used (because PyCharm highlights it)
  • when searching & replacing a variable name with underscores it's less likely that I would accidentally replace some part of a code I don't want (test case name or documentation - these usually contain the spaces between words)

Example of our naming convention:
${GLOBAL_VARIABLE}
${keyword_parameter}

@vmaillol-altair
Copy link

Hello,

I'm not sure than using case to differentiate global variable is a good things because we easily can shadow a global/suite variable using same lower name in a keyword. Perhaps it is better to use dedicated prefix.

@adamzovits
Copy link

adamzovits commented Nov 13, 2023

Hello,

I'm not sure than using case to differentiate global variable is a good things because we easily can shadow a global/suite variable using same lower name in a keyword. Perhaps it is better to use dedicated prefix.

As someone that got bitten by this issue just now, I'll wholeheartedly support this notion to use a prefix for this purpose. We have already used capital letters and underscores for global variable names, but a local variable got declared with a camelcase name (which is treated as equivalent) and the value was reset in the next test case to the globally set value.

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

3 participants