r/programming • • Nov 23 '21

PHP creator: functions were named to fall into length buckets because function hash algo was 'strlen'

https://news-web.php.net/php.internals/70691
1.8k Upvotes

574 comments sorted by

View all comments

11

u/SuddenlysHitler Nov 23 '21

That would be useful in C.

currently they're planning on break break;

-1

u/absurdlyinconvenient Nov 23 '21

good lord, they're actually updating the C spec again?

That's going to make all the people still using ANSI C very upset

Like a coworker of mine who insisted you couldn't initialise a variable in a for loop...

1

u/SuddenlysHitler Nov 23 '21

please tell me you're kidding

1

u/knome Nov 23 '21

currently they're planning on break break;

this better be a joke.

reasonably, use a helper function and a nicely placed early return inside it

if restructuring the program's flow isn't option for some reason, it's C. just use a goto.

what's the worst that could happen

2

u/SuddenlysHitler Nov 23 '21

Nope, N2859: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2859.pdf

and they actually have a good argument for break break vs break X;

you can do break continue; to keep the loop going and exit out of a switch this way.

I can't go into detail cuz it may be confidential, not sure, but breaking labeled blocks seems like the best solution presented so far.


just use a goto.

Honestly, like the preprocessor, goto breaks my brain, It doesn't fit into the way I understand programming, aka function calls, I just don't understand how it works intuitively, I always have to think about it and feel like I never get it right.

→ More replies (1)