Skip to content

Commit

Permalink
Merge pull request #265 from zhaohany/zhaohany/fix-function-names-bes…
Browse files Browse the repository at this point in the history
…t-practice

style: Advertise underscore_separation for function names
  • Loading branch information
Saransh-cpp authored Jan 10, 2025
2 parents 4e91a4a + efc3c9b commit b35394e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ch05construction/02conventions.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def add_to_reaction(a_name,
# ## Naming Conventions

# %% [markdown]
# [Camel case](https://en.wikipedia.org/wiki/Camel_case) is used in the following example, where class name is in UpperCamel, functions in lowerCamel and underscore_separation for variables names. This convention is used broadly in the python community.
# [Camel case](https://en.wikipedia.org/wiki/Camel_case) is used in the following example, where class name is in UpperCamel, functions in lowerCamel and underscore_separation for variable names.

# %%
class ClassName:
Expand All @@ -133,14 +133,12 @@ def methodName(variable_name):


# %% [markdown]
# This other example uses underscore_separation for all the names.
# This other example uses underscore_separation for variable and function names, and CamelCase for class names. This convention is used broadly in the python community.

# %%
class class_name:
class ClassName:
def method_name(a_variable):
m_instance_variable = a_variable


# %% [markdown]
# ## Hungarian Notation

Expand Down

0 comments on commit b35394e

Please sign in to comment.