russkiymalchik / code-refactoring-22-23

0 stars 0 forks source link

Inconsistent Variable Naming #3

Open russkiymalchik opened 1 year ago

russkiymalchik commented 1 year ago

This flaw/smell appear due to variable that may similar to another variable which resulted confusion and hard to maintain in the future.

Names should speak language of business(Mattas Sunny, 2020)

If I asked "Why could this flaw appear?: I probably would say because I generally more task-goal-oriented. so I did what I know without any consideration on the beauty of the code

const header = new Headers();
header.append('Content-Type', 'application/json');

const headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('Authorization', `Bearer ${data.token}`);
LidiaIvanova commented 1 year ago

0,2