Announcing a specification for PHP
21–30 of 263 posts
Re: Announcing a specification for PHP
#22Can someone explain to a layman why this is significant? I'm genuinely curious.
Generally when complex programs (like an entire programming language) are made, there is usually a "specification" of its behaviors. This way, you can communicate to people, hey, my program does ABC and does NOT do XYZ.
Also, it helps you delineate between bugs and what not. My program does AB DEF. Is that a bug? Or a feature? What does the specification say?
Not all programs have a specification. It's a bit formal and unnecessary. Except in a specific scenario where you have multiple/competing implementations of the same programming language. Now that there are multiple players, we need to know exactly which behaviors are per the spec and which behaviors are per the implementation.
All coffee makers must make ABC XYZ. This is the spec.
Sony CoffeeMate makes ABC DEF XYZ. It matches the spec and throws in some extra features.
Samsung Coffee Xtreme makes ABC PQR XY. This also throws in extra features but is actually missing one from the spec.
TL;DR it helps a language evolve independently of its implementations (come the day that a language != its implementation)
Re: Announcing a specification for PHP
#23But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrappers and include them as part of the stdlib? For starters, group them by what they work on (arrays, strings, numbers etc.) as static functions on some relevant class ( String::str_replace(...) ), and later have more methods one can call on the objects themselves ( myStr.replace(...) ).
Is this being worked on? Can this spec help with that?
Re: Announcing a specification for PHP
#24This is great news for the PHP community, and I for one applaud their effort. Contrary to what many HN hipsters seems to believe, PHP is quite a capable language, and HHVM / Hack is really pushing things forward. * Hack introduces type hinting, imo the major lacking part in PHP. * HHVM introduces speed to php. On a personal project calculating perlin noise, I got about 8x speedup on HHVM. * The specification helps pa…
I don't think many would claim that PHP isn't capable. It's that some of us just don't enjoy it and find it to ugly. Especially given how mature competing languages have become.
Re: Announcing a specification for PHP
#25This is great news for the PHP community, and I for one applaud their effort. Contrary to what many HN hipsters seems to believe, PHP is quite a capable language, and HHVM / Hack is really pushing things forward. * Hack introduces type hinting, imo the major lacking part in PHP. * HHVM introduces speed to php. On a personal project calculating perlin noise, I got about 8x speedup on HHVM. * The specification helps pa…
I don't think many would claim that PHP isn't capable. It's that some of us just don't enjoy it and find it to ugly. Especially given how mature competing languages have become.
Re: Announcing a specification for PHP
#26Can someone explain to a layman why this is significant? I'm genuinely curious.
Re: Announcing a specification for PHP
#27Re: Announcing a specification for PHP
#28Can someone explain to a layman why this is significant? I'm genuinely curious.
Hoping to tide you over until a better answer comes along... Generally when complex programs (like an entire programming language) are made, there is usually a "specification" of its behaviors. This way, you can communicate to people, hey, my program does ABC and does NOT do XYZ. Also, it helps you delineate between bugs and what not. My program does AB DEF. Is that a bug? Or a feature? What does the specification sa…
Re: Announcing a specification for PHP
#29Can someone explain to a layman why this is significant? I'm genuinely curious.
Re: Announcing a specification for PHP
#30Can someone explain to a layman why this is significant? I'm genuinely curious.
Secondly, it paves the way for competing implementations. Having more implementations automatically means more performance, because they compete with each other.
And finally, a language specification is also super useful to people who create tools such as IDEs, linters, or compilers/transpilers.