News for hackers. Stuff that matters.
Re:Why do we need modules at all? (2011) by brightball on Tuesday August 27, 2019 @08:38AM (#20808904)
I’m a big fan of Joe...but I also remember PHP before it had namespaces...and it was a train wreck. IMO all of the improvements in the PHP world have happened because they added them.

I can see it for core libraries, but outside of that I think namespaces are necessary for the greater language ecosystem.

Re:Why do we need modules at all? (2011) by nickjj on Tuesday August 27, 2019 @08:43AM (#20808933)
I was there in the PHP 4.x days too during the early 2000s, and you know, I really liked it. It just made things so simple to understand and work with. Look up a function, see a bunch of examples in the docs and use it right away without having to worry about imports and lugging around a ton of baggage.

I think the main reason PHP got such a bad rap for flat functions is because they implemented it poorly. So many things were extremely inconsistent when it came to naming conventions and argument orders that it became near impossible to remember them in a systematic way. But couldn't that problem be addressed today since we're aware that naming consistency is an important programming language feature?

> I can see it for core libraries, but outside of that I think namespaces are necessary for the greater language ecosystem.

Yeah I could get on board with that. Docker sort of does this now with Docker images. At the UI level (the tooling we use in our day to day like the CLI) we don't need to access "elixir" or "python" images with a namespace (Docker adds it for us automatically), but we are free to create our own brightball/elixir or nickjj/elixir images to avoid conflicts.

But in a programming world, I would like to type brightball_elixir at call time in my code instead of importing elixir from brightball, because with the latter I have no idea if elixir is coming from you, me, or the standard library unless I move away from the code and look at the import.

Re:Why do we need modules at all? (2011) by brightball on Tuesday August 27, 2019 @09:01AM (#20809066)
I'm mainly talking about the framework world at that time. They all reinvented EVERYTHING because they couldn't just easily include a shared database library, templating library, etc. They all reproduced their own with their own names to get around it.

That type of stuff. The core language was about the same regardless, but the ecosystem improved dramatically.

Re:Why do we need modules at all? (2011) by nickjj on Tuesday August 27, 2019 @09:18AM (#20809225)
Ah ok. When it came to using PHP back then I didn't even use third party frameworks. I just cherry picked things like database libraries and pulled them into my code base.
Re:Why do we need modules at all? (2011) by ggg3 on Tuesday August 27, 2019 @10:31PM (#20816370)
you should re-read the article. the main point is that it will solve frameworks (not exactly what the author aimed at, this I am extrapolating) reinventing everything. all utils methods will live in the proposed repository in the sky with all methods. frameworks will just contain their higher level logic, until that becomes common enough to use standard types in the util repository in the sky.
Re:Why do we need modules at all? (2011) by adev_ on Tuesday August 27, 2019 @09:06AM (#20809113)
> I’m a big fan of Joe...but I also remember PHP before it had namespaces.

To be picky: module and namespace are different concepts.

C++ has namespace and (soon) will have namespaces AND modules.

Namespaces can be seen in C++ as a pure hardcoded prefix for your functions and are a perfectly valid concept with Joe's idea of a "giant KV store for functions".