Hacker News new | ask | show | jobs
by pluma 3972 days ago
Python and most JS module systems have namespace-based imports. The idea is that the entire content of a module is wrapped in a namespace (i.e. an object). This allows maintaining a clear separation between your local names and the imported names, you have full control over what names in your local namespace are touched when a module is imported.

I think using PHP as an example in defnese is misguided -- I don't think anyone here would argue that PHP is a good introduction to programming although it's certainly something that introduced a lot of "us" to programming ("us" being web developers who started with programming in the late 1990s or the turn of the millennium).

> Because that's not the case for Python or PHP on linux too? I bet it is,and it has nothing to do with the language itself.

It has everything to do with the language. There's no point learning any language if you won't be able to try it out. So availability is a major factor.

PHP is supported by nearly every a-buck-a-month webspace host out there, which is why it is so accessible to anyone who can figure out how to use FTP. JavaScript is supported by the browser itself -- something nearly everyone is likely to have already installed on their computer.

Python, Ruby and so on have to actually be installed locally. And even if your package manager for some reason doesn't have Python 3 available you can nearly always get a fairly recent version of Python 2 and PIP. But even so, Python is only marginally easier to set up than Ruby.

> Your opinion but some points aren't fair at all.

Sure. I didn't say there is a language that meets all of my requirements. But that's precisely the point: there is no perfect language, but IMO there are generally better choices than Ruby. Which choice is best for any given situation of course depends on how you weigh the different factors (e.g. Ruby is likely the best choice for parents who already are Ruby programmers).