So, while writing the infractions UI, it occurred to me that I'd quite like a feature I've seen in other languages, namely what C# calls the Math.Clamp (or under some cases, Math.Clampf because it's not loosely typed)
In other words, a function that brings this to being a core language feature:
Code: [Select]
So I thought it might be nice to suggest it, it's a small language improvement, makes code more readable and whatnot and I'm put off for life. It's almost like the process is designed to reject external ideas. Adding a feature requires an RFC, https://wiki.php.net/rfc/howto which leads you to https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process and I was like 'wut?'
It's stuff like that which means if I want to suggest what is conceptually to me a simple PHP feature, I'd have to learn C, learn PHP's inner code (I have some ideas, but not enough to get out and write this one off the bat) and submit it as a fully fledged patch. Yay.
I'm a little annoyed at the gamut but I do understand. It's sort of nice to be on the other side of the 'YOU KNOW WHAT WOULD BE COOL' debates for a change, sort of refreshing and grounding. But it doesn't feel nice.
In other words, a function that brings this to being a core language feature:
function clamp($value, $min, $max)
{
return min(max($value, $min), $max);
}So I thought it might be nice to suggest it, it's a small language improvement, makes code more readable and whatnot and I'm put off for life. It's almost like the process is designed to reject external ideas. Adding a feature requires an RFC, https://wiki.php.net/rfc/howto which leads you to https://blogs.oracle.com/opal/entry/the_mysterious_php_rfc_process and I was like 'wut?'
It's stuff like that which means if I want to suggest what is conceptually to me a simple PHP feature, I'd have to learn C, learn PHP's inner code (I have some ideas, but not enough to get out and write this one off the bat) and submit it as a fully fledged patch. Yay.
I'm a little annoyed at the gamut but I do understand. It's sort of nice to be on the other side of the 'YOU KNOW WHAT WOULD BE COOL' debates for a change, sort of refreshing and grounding. But it doesn't feel nice.



