Skip to main content

JavaScript Coding Ninja

Code Quality: Ninja Code

Are one-letter variables a practical idea to use in programming?

View Answer:
Interview Response: No, they can confuse developers in a team environment and make it harder to debug your code.

Is it a good idea to abbreviate variable and function names?

View Answer:
Interview Response: No, they can confuse a team coders environment and make it harder to debug your code.

Is it a good idea in JavaScript to overlap variables?

View Answer:
Interview Response: No, they can generate confusion in a collaborative atmosphere and make debugging your code more complex. Overlapping is not a good idea since it might lead to mistakes farther down in your code's layers.

Code Example:

let user = authenticateUser(); // Global declaration of the user

function render() {
let user = anotherValue(); // Overlapping declaration of the user
...
...many lines...
...
... // <-- a programmer wants to work with a user here and...
...
}