5 ms·
Sometimes I think time has come for somebody to fork php, fix all the little quirks and relaunch it as a new language, simpler and more adapted to the web world
by TweedHeads 18y ago
Sometimes I think time has come for somebody to fork php, fix all the little quirks and relaunch it as a new language, simpler and more adapted to the web world of today.
Blog\save() is one of them
Using the dot as concatenator is another one.
And there are hundreds that haven´t been touched because of fear of backward compatibility uprising.
- jamongkad 18y agoAgreed.
- nimrody 18y agoNobody uses PHP because it is beautiful... Creating your own version would make you loose the one true benefit of PHP: easy deployment using many available hosting services. Unless, of course, you manage to make it popular as the original (just remember to maintain backward compatibility with thousands of libraries!)
- halo 18y agoYou could compile down to PHP. A similar approach has become popular with JavaScript.
- gord 18y agoNot a bad idea.. you could write in your lang of choice, presumably Ruby or Python, Scheme/lisp with a syntax / DSL you like.. then generate obfuscated/compressed PHP to run on the many cheap LAMP hosting platforms :]
- nimrody 18y agoIt works, but is more difficult to debug and, of course, to integrate with existing libraries. I don't think many have taken this path - GWT has not exactly taken the developer community by storm. Even minimal approaches (e.g. QT extending C++ syntax to deal with signals and slots) is considered unacceptable by many.
- wvenable 18y agoI can live with a lot of the crap. I understand the history and practicality of it. But the backslash for namespaces. That's just too much. There's no history for it. There's no good reason for it. It's just stupid and ugly. If someone forked PHP tomorrow and changed just that one thing for now I'd probably use the fork. The decision shows that PHP will not get better.
- asnyder 18y agoThe above sounds like a religious statement. What difference does it make that it's a \ over a .? It does what it needs to do.
- lucumo 18y agoI think most people have internalised the notion of backslash being the escape operator. That's the way it's used in a lot of languages. Using it for something different not only feels dirty, it may also make it harder to get the "feel" (i.e. to quickly recognize and use) of the namespace operator. Maybe that concern is invalid and we'll quickly adjust. Since this is what the PHP folks have decided, we'll soon get the chance to find out.
- asnyder 18y agoIn PHP the backslash is also an escape operator, but only when used within the confines of a string. In this case, you're not within a string, so it shouldn't be confusing. But like you said, we'll soon get the chance to find out.
- vito 18y agoBut you could be. "$foo = "Bar\test"; $foo();" is entirely plausible but doesn't give do what you expect; you need to escape the \.
- lucumo 18y agoAllow me to clarify. I don't mean that it's confusing or ambiguous. What I mean is that the only place people have seen the backslash in their language and many other places is as an escape operator. This means that the backslash - when seen alone - was most likely to be an escape character. When scanning code, you often use "landmarks" to find your way about. This is why indentation is so useful. But this is also used on a smaller level. When seeing a comma, you usually expect to find something else after it, just because that's what you're used to. The same can hold for backslashes. Personally, I "feel" that backslashes are an escape character to such a degree that to see one without an escaped item after it, feels like a syntax error. Now, I'm not arguing that this is a terrible choice of the PHP folks - at least we finally get namespaces - but I do understand how some people find the backspace an irritating choice.