Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One thing I really dislike about PHP is the global scope and imports. Introduction of namespaces is an improvement but it does not change the fact that everything is in global scope. The best practice for imports is to not include them outside of execution context, but it also makes it very hard to reason about what is actually being used by the file + you try to think about not loading files unnecessarily so it's not uncommon to add the import statement in the same file multiple times before using something and there are no type hints that say whether the include was imported or not. Which is more or less a consquence of the environment not having a proper runtime and everything being re-initialized with every request (in a runtime context, all files that would ever by used would be included, because they would be used eventually). I genuinely wonder how it came to be that a language developed specifically to serve web requests is not a loop, you would think that a runtime would be especially useful for handling requests and Facebook learned it the hard way, heck CLI input -> output programs are probably the only type of program where it would not be a limitation.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: