|
|
Subscribe / Log in / New account

PHP and P++

PHP and P++

Posted Aug 15, 2019 22:22 UTC (Thu) by roc (subscriber, #30627)
In reply to: PHP and P++ by dskoll
Parent article: PHP and P++

Rust's edition system is working pretty well so far. The key points are:
1) have modules explicitly state which edition they use and make sure all your tools respect that.
2) have tools available from day 1 of the new edition that automatically update code to the new edition as much as possible, and emit clear messages where non-automatic changes need to be made.
3) ensure modules from different editions can be used together, and make that as seamless as possible. For example, Rust introduced "raw identifiers" that let you write identifiers that are reserved words, so if a module API uses an identifier that's a reserved word in a later edition, code in the later edition can still use it.

This constrains the kinds of changes you can make between editions, but it does allow you to make a lot of significant backwards-incompatible changes. It works better when your language is strongly statically-typed like Rust.

Python completely failed at 1, 2 and 3, for various reasons.


to post comments

PHP and P++

Posted Aug 15, 2019 22:35 UTC (Thu) by roc (subscriber, #30627) [Link]

Oh, you also kind of want

4) have a tool that reformats source code automatically (especially line breaks) and encourage a culture of using it routinely

so that you can run that tool after applying the automatic updates from point 2. Not a big deal, though you want this for other reasons too.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds