What does this mean?Last year I was picked to speak at PHP.
The talks were great, but the highlight of the whole conference was a panel discussion with 3 men who have been around long enough they might as well be considered the “godfathers of PHP”.
Rasmus Lerdorf (PHP founder), Sebastian Bergman (PHPUnit) and Derick Rethans (xDebug).
It started with a fun Q&A (Rasmus would be definitely good late night talk show host), but then the topic quickly led to the history of PHP and why the API is too confusing.
One method is called strpos, the second is is_string, and the third is substr.
PHP: a fractal of bad design has more examples.
Rasmus explained that PHP code is full of inconsistencies for a single reason — to keep it as back -compatible as possible.
I think Rasmus is a very practical person and he cares about usability, since upgrading a PHP project is a relatively easy process with fewer BC breaks.
But this comes at a cost: inconsistent naming, that you have to memorize.
That’s why there is a place for helper packages like NetteStrings, voku/portable-utf8, etc.
, that try to make these methods easier to remember, or thecodingmachine/safe that covers inconsistent return values.
AST solves this in the same way it was able to change 1000 windows for a modern one.
Let’s say you rename strposto string_positionin PHP core and drop the strpos function.
This would break 78.
9 % of all websites the PHP runs on.
Even if the PHP community decided unanimously to do make move, you have to keep the old name for back-compatibility.
But with AST, you don’t have to care about back-compatibility breaks.
Just say “AST, rename all functions strpos to string_position”.
Imagine this as part of a composer update.
So, your code will look as modern as it was written in <current year>.
Shameless plug: I work on an open-sourced tool called Rector, where such a change is simply a matter of 1 yaml config.
But I know there is much more room for startups to make use of AST then we can imagine.
And what do you think about the rising popularity of frameworks like Symfony on top of projects like Shopsys Framework or Laravel are built?When people start to build on each other’s shoulders, it’s a sign that the community is stable.
There is trust, growth, and a common goal — to make the best PHP applications we can and really enjoy it.
I’m really grateful for the Symfony ecosystem that allows so many other projects to grow.
The stability is like nothing else in the software world.
The direction is clear, now we have to sail to new horizons :)Thank you, Tomas, and all the best in 2019.
Is there anything you’d like to see happen within the Shopsys Framework community?I hope you all continue to experiment, learn and explore innovations.
Luck favors the adventurous!.I think your team has the skills and balls for this since you were able to successfully move to open-source in one year from a previous 15 as a private model.
That’s a very brave move, and I think you’ll be able to keep making great changes.
.. More details