Skip to content

Commit

Permalink
Update task.md
Browse files Browse the repository at this point in the history
language checked
  • Loading branch information
stephen-hero authored and onewhl committed Jan 24, 2024
1 parent 197d0a6 commit e01f461
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RenamingCode/NamingRules/Theory/task.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Task 1/2: Naming rules

Naming is one of the most important parts of code writing, as it significantly affects code understandability.
A good name should be **descriptive** and **unambiguous** and clearly reflect what code does.
A good name should be **descriptive**, **unambiguous** and clearly reflect what the code does.
Poor names lead to confusion and make it harder for other developers to understand and reuse the code.

One of the most frequently used refactorings is **Rename refactoring**.
We change the name of a code element to make it more expressive and complying with naming conventions, or fix typos.
One of the most frequently used refactorings is the **Rename refactoring**.
With this, we change the name of a code element to make it more expressive, to comply with naming conventions, or to fix typos.

Here is a **set of rules** that we recommend to keep in mind when you try to come up with a good name:
- The name of a package is usually a lowercase noun or a combination of nouns written in camelCase.
For example, `org.example.project` or `org.example.myProject`.
- The name of a class should start with an uppercase letter and contain a noun or a combination of nouns written according to the
[camelCase](https://en.wikipedia.org/wiki/Camel_case) naming convention. The name should describe what the class is or what it does.
For example, `FileReader`, `NetworkManager`, or `ErrorReporter`.
- The names of functions, properties, and local variables start with a lowercase letter and use the camel case without underscores.
- The names of functions, properties, and local variables start with a lowercase letter and use camelCase without underscores.
For example, `getType()`, `handleRecord()`, `createMetaObject()`.
- Use the [AI Assistant](https://blog.jetbrains.com/idea/2023/06/ai-assistant-in-jetbrains-ides/) to come up with better names for code entities if you feel stuck.
It is an IntelliJ IDEA plugin that uses ChatGPT to help with programming tasks (available only in EAP builds).

0 comments on commit e01f461

Please sign in to comment.