DevKaranJ / ToDo-list

MIT License
0 stars 0 forks source link

Enhancing Code Clarity and Efficiency through DRY, KISS, and YAGNI Principles #4

Open DevKaranJ opened 1 year ago

DevKaranJ commented 1 year ago

Greetings! ๐ŸŒŸ In this issue, I'm on a mission to boost our code's clarity and efficiency by embracing the DRY (Don't Repeat Yourself), KISS (Keep It Simple, Stupid), and YAGNI (You Ain't Gonna Need It) principles. I've identified specific areas where we can trim redundancy, simplify complexity, and trim any unnecessary bits. ๐Ÿงน

DevKaranJ commented 1 year ago

The variable names taskTextand task are both a bit vague. It would be better to use names that more accurately reflect the purpose of the variables, such as taskDescriptionand taskInput.

!./src/modules/editFunctions.js

export function enableTaskEditing(taskDescription) {
  taskDescription.contentEditable = true;
  taskDescription.focus();
}

export function saveTaskEdit(taskDescription) {
  taskDescription.contentEditable = false;
}

## Line numbers

* Line 1: The variable name `taskText` is vague.
* Line 2: The variable name `task` is vague.
DevKaranJ commented 1 year ago

๐Ÿ› Code quality issues in main.js ๐Ÿ›

The code in main.js violates the DRY ๐Ÿงป, KISS ๐Ÿ’‹, and YAGNI ๐Ÿคทโ€โ™‚๏ธ principles. It also uses global variables ๐ŸŒŽ and does not use strict mode ๐Ÿ”.

Here are some suggestions for how to fix these issues:

I hope these suggestions help you improve the quality of your code! โœจ