←back to thread

PHP 8.5

(stitcher.io)
201 points brentroose | 2 comments | | HN request time: 0.499s | source
Show context
darkamaul ◴[] No.45990664[source]
PHP's evolution since PHP 5 has been substantial, and I think this is a real problem. As someone who learned the language years ago, the pace of change (generics, attributes, match expressions, typed properties) makes modern codebases genuinely difficult to follow.

I suspect this affects many developers who cut their teeth on PHP but haven't kept up. The language has become a different beast, which is a strength for the community but a barrier to re-entry.

replies(12): >>45990804 #>>45990834 #>>45990835 #>>45990949 #>>45991400 #>>45992500 #>>45992620 #>>45992776 #>>45993443 #>>45993687 #>>45995052 #>>45995108 #
pjmlp ◴[] No.45990949[source]
This is true for most languages though, compare C# 14 with C# 1.0, Java 25 with Java 1.0, C 23 (plus common compiler extensions) with K&R C,....
replies(2): >>45991209 #>>45991349 #
deaddodo ◴[] No.45991349[source]
C hasn’t changed all that much, and someone who coded in C99 would take about 30mins to catch up to a modern C23 codebase’s changes. Famously so, as conservatism to change is the main friction in the community for about two decades now.

If you pull out examples of the earliest C, sure, it looks weird. But that C was already obsolete in 1989. Since then, it’s had a minor iteration (e.g. five-eight additions/modifications) every decade-ish (99, 11, 17, 23). Has it changed? Sure. Can it be compared to the iteration and speed of things like C#, Java, C++, etc? No way.

replies(4): >>45991842 #>>45992272 #>>45992334 #>>45993480 #
1. rini17 ◴[] No.45992334[source]
You can learn everything about undefined behavior in 30mins?
replies(1): >>45992744 #
2. deaddodo ◴[] No.45992744[source]
It's moot to the aforementioned point. Undefined behavior wasn't introduced as a new language "feature" between C89 and C23; it's existed the whole time. We're talking about specification deltas, not the entire corpus.

But, if you want an answer to your question:

You can learn to avoid undefined behavior in about 30 seconds.

If you're purposefully fiddling with undefined behavior, it's because (ideally) you're A) an advanced developer and you know exactly what you're trying to achieve (and inspecting the generated code) and/or B) you're using a specific compiler and don't plan on porting your code elsewhere.