Python Questions

Daniel Duffy

C++ author, trainer
Scary. It means we have to be extra vigilant with larger system and functions. In the early days of C++ libraries had names like ACMECompanyRange().
So, Python won't help and it is the developers' job to watch out.
 
Last edited:

pingu

Well-Known Member

Daniel Duffy

C++ author, trainer
Due diligence, thus.
BTW I always get a tummy pain every time I see the word 'Hitchhiker'.

I suppose the real issue in this case for me is that Python uses duck typing. OK.
 

Daniel Duffy

C++ author, trainer
I am browsing some 1-liners from Zen of Python

Namespaces are one honking great idea -- let's do more of those!
I agree 100%. However, is it used a lot?

There should be one—and preferably only one—obvious way to do it.
I don't agree, not at all. The software world is too complex for such a naïve assumption.
 

Daniel Duffy

C++ author, trainer
So, one can put functions and so on in modules which is good practice. System decomposition into independent and loosely coupled modules is recommended before jumping head first into coding marathons.

For example: if we want to overload range() we can put the code in a separate module and then just use it in client code as essentially a namespace, much like C++ and C#, for example.
 
Last edited:
Top