Page 1 of 1

Bug #48669: PHP includes 'goto'

Posted: 2009.08.21 (23:25)
by scythe
Ahaha.
why turn the language into a public menace?
Too late!

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.08.22 (04:28)
by PsychoSnail
I don't really think goto is too bad, as long as you don't overuse it.
For some reason, Java has a goto keyword that doesn't do anything.

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.08.22 (05:19)
by t̷s͢uk̕a͡t͜ư
Yeah, PHP even has "variable variables."

To illustrate:

Code: Select all

$foo = "bar";
$bar = 3;
print $$foo;
...will print "3".

PHP is an amateurish sack of crap.

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.08.30 (04:57)
by jean-luc
I really disagree with this general sense that PHP is crap. PHP is very flexible, which certainly enables some bad behavior, but also makes it fast to do complex things. There's a reason that the variable variable function exists in PHP, and it allows for some complicated algorithms that involve quite a bit more code in other languages. I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.

There seems to be a dislike of PHP because it allows things that typically would not work to work. I don't think enforcing strict code forms is really a vital feature of a language, and I'm suspect of people that dislike languages because of their flexibility. I've yet to see a compelling reason that there's really anything wrong with PHP. don't like a feature? just don't use it. I can show you plenty of crap in other languages that people consider more 'pure.'

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.08.30 (16:42)
by smartalco
jean-luc wrote:I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.
This. php.net has the best documentation of just about anything I have ever used (with a competent search to boot).

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.08.31 (08:57)
by 乳头的早餐谷物
smartalco wrote:
jean-luc wrote:I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.
This. php.net has the best documentation of just about anything I have ever used (with a competent search to boot).
And the documentation needs to be good, because otherwise with PHP's disorganised functions you'd never be able find your way around.

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.09.01 (00:04)
by t̷s͢uk̕a͡t͜ư
jean-luc wrote:I really disagree with this general sense that PHP is crap. PHP is very flexible, which certainly enables some bad behavior, but also makes it fast to do complex things. There's a reason that the variable variable function exists in PHP, and it allows for some complicated algorithms that involve quite a bit more code in other languages. I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.

There seems to be a dislike of PHP because it allows things that typically would not work to work. I don't think enforcing strict code forms is really a vital feature of a language, and I'm suspect of people that dislike languages because of their flexibility. I've yet to see a compelling reason that there's really anything wrong with PHP. don't like a feature? just don't use it. I can show you plenty of crap in other languages that people consider more 'pure.'
I will continue to be openly hostile to anything that promotes terrible programming practice. Imagine a generation of programmers tainted by an inclination to hack their way through a problem because they're used to that being the appropriate means of solving one. Teamwork and organization go right out the friggin' window along with potential for easy documentation, and debugging would be a total nightmare.

Back when I still did my job with Perl, I had a very nasty habit of completely outsmarting myself. I wasn't writing poetry, either -- I was using the language in a way that took advantage of its flexibility, and not in a needlessly complicated manner. In many cases, it would have taken far less time to just rewrite my code than try to make sense of it again, it wasn't usable or readable by anyone else but me, and tracking down bugs required hours and hours of unraveling my work. Yes, it was quick to write, extremely flexible, and a godsend for dirty one-time hacks, but it became abundantly clear that languages well adapted for these things should have no place for larger projects.
I was at one point an avid reader of Steve Yegge's blog, and he had an excellent post about why he attaches a negative weight to experience with Perl in his hiring decisions.

PHP ruins potentially good programmers. It's the new BASIC.

Re: Bug #48669: PHP includes 'goto'

Posted: 2009.09.02 (03:24)
by scythe
smartalco wrote:
jean-luc wrote:I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.
This. php.net has the best documentation of just about anything I have ever used (with a competent search to boot).
The hell have you been using? php's documentation is nice, but at the very least Ruby is much nicer -- _why's ruby stuff was easily the best documentation available for anything, period.
http://mislav.uniqpath.com/poignant-guide/
I really disagree with this general sense that PHP is crap. PHP is very flexible, which certainly enables some bad behavior, but also makes it fast to do complex things.
PHP's syntax doesn't do a whole lot to make that easier. mod_php's <?php ?> tags do that.
There's a reason that the variable variable function exists in PHP, and it allows for some complicated algorithms that involve quite a bit more code in other languages. I think PHP's ease of use without sacrificing power makes it very competitive as a scripting language, and it's massive user base makes it an excellent choice for web work.
Perl, Python, Ruby, and Lua are all less verbose than PHP.

What's funny is that PHP is not meant to appeal to new programmers. It's meant to appeal to C programmers, who don't want to deal with anything new. It is meant to look like C. Even printing is aped from C -- where do you think they came up with "printf"? It's not powerful in any meaningful way, it's usable and embeddable, which are excellent characteristics, but they're not characteristics of the language as of the implementation.
There seems to be a dislike of PHP because it allows things that typically would not work to work. I don't think enforcing strict code forms is really a vital feature of a language, and I'm suspect of people that dislike languages because of their flexibility.
What are you comparing php to, Java? It only gained closures relatively recently, it still has that ugly $variable syntax, and, many languages can do variable->variable: it's called eval. Perl and Lisp are flexible. PHP is not flexible; it's just most people's introduction to duck typing.