+ 3

Python coders in general: I see a tendency to write several transformations single line code. reader unfriendly? Discuss.

Python coding styles

25th Jul 2019, 2:52 PM
Alistair
3 Respostas
+ 2
I really really think that "unfriendly" is a strong word in this case. What is unfriendly? - If you know what you are doing, if you know if you master the technique / the language, they are not unfriendly. even 10 + 10 = 20 can be unfriendly for those who don't know math.
25th Jul 2019, 8:45 PM
Ronaldo Marques
Ronaldo Marques - avatar
+ 1
Well, I am not talking about basics obviously. Unfriendly - I would say legibilit is decreasing signicifantly when increasing number of transformations in one line. If you really think you need to reduce lines of code (which is certainly good practice as well) then we can apply object oriented concepts and perform code refactoring i.e. pulling out procedures, classes , use inheritance etc. is that not better practice overall?
26th Jul 2019, 6:59 AM
Alistair
0
Great! Yes, OOP, functions, recursion, libs, etc. I got it, now understood better (sorry my english is not perfect yet). It is preferable to use good language resources before making code unfriendly. This way I agree with you =) I am a example. some times I cant write the best code version... hehehe.
26th Jul 2019, 1:58 PM
Ronaldo Marques
Ronaldo Marques - avatar