# File name conventions, CamelCase vs python\_lower\_case

**URL:** <https://forum.robotframework.org/t/file-name-conventions-camelcase-vs-python-lower-case/5640>\
**Category:** Robot Framework\
**Created:** [3 May 2023 19:08 UTC](https://forum.robotframework.org/t/file-name-conventions-camelcase-vs-python-lower-case/5640 "2023-05-03T19:08:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lennart](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/lennart/32/2587_2.png) [@Lennart](https://forum.robotframework.org/u/Lennart)\
**Post date:** [3 May 2023 19:08 UTC](https://forum.robotframework.org/t/file-name-conventions-camelcase-vs-python-lower-case/5640/1 "2023-05-03T19:08:28Z")

</div>

I’ve been using camel case with upper case first char for Robot source code files and lower case with underscores for Python code, but I keep seeing other naming schemes. Is there a “right way” to name files?

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [4 May 2023 05:39 UTC](https://forum.robotframework.org/t/file-name-conventions-camelcase-vs-python-lower-case/5640/2 "2023-05-04T05:39:11Z")

</div>

Hi Lennart,

Generally the is no “right way” though there are many who have their beliefs if what is the “right way” and “wrong way”, I’m of the school of thought that it doesn’t matter as long as your consistent.

There are some things to consider here though:

- In Windows these are all considered the same file, in \*nix (e.g. Linux & MacOS) they are all considered different files, so you need to be aware of potential file name conflicts:
  - example\_file.py
  - Example\_File.py
  - EXAMPLE\_FILE.py
  - eXAMPLE\_fILE.py

- In some cases python cares about the case of the file name and even the case of the directory the is in (particularly around python classes).

Dave.

---

<div class="post-metadata">

**Author:** ![robinmackaij](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/robinmackaij/32/126_2.png) [@robinmackaij](https://forum.robotframework.org/u/robinmackaij)\
**Post date:** [4 May 2023 19:34 UTC](https://forum.robotframework.org/t/file-name-conventions-camelcase-vs-python-lower-case/5640/3 "2023-05-04T19:34:00Z")

</div>

There is work being done on the style guide I believe and some rules in tidy / robocop have to do with casing of variables / keywords / test case names.

That being said: it’s a tricky matter, especially when it comes to variables and their casing in relation to their scope. To quickly “see” the scope of a variable, ideally you’d have a different casing for each scope.

The challenge: there’s 4 scopes (global, suite, test, local). Personally, I use snake\_case for local scope variables and CAPITAL\_CASE for global and suite scope (since they are often the same or overlap quite a bit). I try to refrain from using test scope variables, but I would opt for lowerCamel since UpperCamel is generally used for LibraryNames.
