Hacker News new | ask | show | jobs
by densh 5085 days ago
People never seem to fully understand namespaces. You don't need any additional prefixes for classes and functions inside of your module. Its name already does separate it from everything else. Moreover "from module import *" is evil. Period.

import newstruct as ns

...

x = ns.long()

1 comments

Makes me think.. is the NS prefix in cocoa frameworks short for "newstruct"? I always wondered about that one.

    > Cocoa classes begin with the acronym "NS" (standing either for the
    > NeXT-Sun creation of OpenStep, or for the original proprietary term
    > for the OpenStep framework, NeXTSTEP)
http://en.wikipedia.org/wiki/Cocoa_(API)#Cocoa_history