4 ms·
The fact is that as much as everyone likes to complain about parameter order, the only case I've seen with the needle/haystack order flipped is the in_array() m
by encoderer 17y ago
The fact is that as much as everyone likes to complain about parameter order, the only case I've seen with the needle/haystack order flipped is the in_array() method, which in that context the flipped order just makes sense.
And I'm not sure what you mean by "weird scoping."
The real beef most people have with PHP -- and is hard to defend -- is its type coercion. But PHP is not alone here, any implicit coercions are bound to make somebody unhappy some of the time.
In summary, you're jumping on a bandwagon without any merit. Say that you can make better applications and in less time in another language. Say that you can find more talented programmers for less money. But of all the things to whine about you chose the namespace operator? Really?
- wvenable 17y agoYou completely missed the point. Yes, you can defend all those things individually. And individually, they aren't a big deal. But together PHP seems like a big ball of mud. I'm actually a big user (and defender) of PHP; between posting this I'm working on PHP code. I've used it since PHP 3.0 and I'm pretty forgiving of legacy problems -- it's an organic language with pieces added when they're needed. The PHP 3.0 time was great because every release (which was frequent) brought some new feature you were wishing for. PHP 5.0 has been great and PHP 6.0 with unicode is going to be a nice addition too. But it's like 2 steps forward and 1 step back. There's no reason for PHP to add namespaces in such a confusing and different way. PHP borrows from C, Java, Perl, and C++ and anyone familiar with those languages is going to feel comfortable with it. But this namespace implementation is just bizarre. And it can't be blamed on any legacy issues or backwards compatibility.
- encoderer 17y agoI'd like to dial this back a bit. But not without saying that knocking down strawmen is not "defending things individually." And really... you find it "confusing and different" that PHP uses a backslash for delimitation? Seriously? You can simultaneously wrap your mind around recursion, closures, pointer arithmetic and continuations but you're confused by the use of a backslash opposed to a colon, double-colon or triple colon? Confusing and Different? Seriously? Variety is unambiguously good. This is mutation and evolution. And it results in languages as fantastically different as Haskell, C, F#, Python, Perl, Lisp and even PHP. Programmers are by and large a smart bunch and the last thing we need to do is dumb-down languages for the least common denominator.
- wvenable 17y agoFrom a previous link on this subject: Java: Attribute/Method access: foo.bar Static method access: Foo.bar Package access: foo.bar.baz C#: Attribute/Method access: foo.bar Static method access: Foo.bar Namespace access: foo.bar.baz Python: Attribute/Method access: foo.bar Static method access: Foo.bar Module access: foo.bar.baz C++ Attribute/Method access: foo.bar and foo->bar Static method access: Foo::bar Namespace access: Foo::bar Perl: Attribute/Method access: $foo->bar Static method access: Foo::bar Module access: Foo::bar PHP: Attribute/Method access: $foo->bar Static method access: Foo::bar Namespace access: Foo\bar Variety is not unambiguously good. Variety is good if you're producing something different. Variety is bad if it's different for no reason. I work in many different languages, and having to learn yet another syntax unnecessarily is not a good thing. The PHP developers had a chance to add namespaces in a way that didn't make the language worse -- they didn't do that. Sure, maybe it's not a big deal -- just like all the other bad decisions, like magic_quotes, weren't a big deal. It's just disappointing that they couldn't do it right.
- encoderer 17y agoThis is bordering on amusing to me now... Frankly, and I hate to devolve into the ad hominem, you're taking this religiously. You've turned this into a Bikeshed issue. This is only a "bad decision" because you've decided that YOU know TheWay. Those languages that use the dot for scope resolution have created an ambiguous operator in the plus sign. Concatenation? Addition? In a dynamic language you'll have to do some looking. And that's a good thing? Just because it's familar to you? And for your test of variety, I truly enjoy that you ommitted every single langauge that would give you some actual variety. You chose 6 languages all from the same paradigm. This is the last reply I'll be writing. I made the mistake of thinking that if you are a programmer, able to presumably create software that actually ships and makes peoples lives easier, you MUST be able to hold and weigh opposing view points and judge the relevance of things. I honestly wonder if you're the type that sits on the team, picks apart working code, and refactors and refactors and never actually ships. I'm not saying you are but I am saying that everyone of those types that I have come across share your same academic sense of RightWay and WrongWay. There are things that each language does wrong, that is, things that are confusing. But if you are CONFUSED by a backslash, you ought to reconsider your choice of profession. And finally, something you seem to have glossed over, is that if you find this as important as you seem, why don't you take the opportunity to create a working patch that uses the double-colon?