tjguk / wmi

102 stars 29 forks source link

Your's code needs Code Review! #13

Open maveius opened 4 years ago

maveius commented 4 years ago

Let's strart: In wmi.py line 1311 i saw obj = GetObject(moniker)

  1. What is "Object" ?
  2. Why variable is called obj ?
    • This is shortcut of object, but this is very bad way to name classes and variables by object keyword, because we don't know what it is actually. Have you ever read "Unklebob" Robert C. Martin "Clean code"?
    • The same why you use shortcut name instead of full varaible name? This was described too in "Clean Code".
Evernow commented 2 years ago

This is provided to you for free by someone simply doing it in their free time. He doesn't need to do anything.

maveius commented 2 years ago

Ok. If someone does something in their free time that means that can use not clarify the naming convention and can use "dirty code"? What if someone needs to use it? Or debug?

Evernow commented 2 years ago

that means that can use not clarify the naming convention and can use "dirty code"?

Yes. They have no obligation to do anything and can do whatever they want in their code.