+ 1
What is the best way of writing code?
I often write stupid codes like from secrets import token_hex as t from random import randint as r print(''.join(list(map(lambda x : x.upper() if r(0,2) else x , list(t(24))))))#generates 24 digit key with uppercase and lowercase letters with numbers Because I don't want codes to be redundant and make my code of 1000 lines. I often lose track of everything. How can i write them in a understandable way without silly comments or variables?
4 ответов
+ 5
Long codes are not difficult to maintain, if they are good...
+ 4
Use proper, meaningful names and correct formatting.
+ 3
For python you can check out PEP: https://www.sololearn.com/learn/Python/2483/
+ 1
~ swim ~ I am expecting that you will help me to write code which is neither long nor short. You can tell me what to avoid , how to write, some useful resources, etc. Long codes are hard to maintain and short ones are hard to understand.