NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Worse is better, obviously (Score:2)
Sadly
gotois a useful construction in C, because the flow control primitives are, well, far more primitive than Perl. For example, you can only break out of the innermost loop.Perl's
gotohas something that isn't offered by C or PHP -goto &NAME[perl.org]. That form is really the only form that anyone should be using in Perl code, and then only when they know what they're doing and why. I don't know PHP, but either it has flow control structures as powerful as Perl's, in which casegotois not needed, or the flow control structures themselves should have been enhanced, rather than addinggoto. Either way, what they did is daft.Your stats don't line up. You're grepping all files, not just C code initially, and I don't believe that your find commands do what you expect.
So most of PHP's C
gotos are in extensions, whereas most of Perl's are in the core. But what are all those other files in the PHP habouring gotos?What are
.reand.c.origfiles?Reply to This
Re: (Score:1)
Thanks for providing more accurate (or.. much more accurate) finds
I also liked the explanation you gave on the use of gotos. I had a discussion about that with a colleague (who is a Python programmer) and we got around to labels and I tried to explain that Perl has label-aware loop commands. That you can
lastto a label. In PHP, you cancontinuean amount of loops outside (continue 3would exit 3 loops above) while apparently in Python you can't do either, onlybreakandloop.I guess what I'm saying is that
Re: (Score:1)
Oh, and I have no idea what the other files are. Maybe files that should be cleaned?
A quick plug for ack (Score:2)
is just
--cc means "C source and headers only", --cpp is "C++ source and headers only", -w means "word only".
Just install CPAN package App::Ack.
--
xoa
Re: (Score:1)
*beats head on wall*
Thanks Andy :)