We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
The Best of strong Typing for PHP | Damien Seguy
Discover the best practices for strong typing in PHP, including defining interfaces, using the Ester approach, and avoiding null usage, with expert Damien Seguy sharing his insights.
- Strong Typing in PHP is thin, but it’s not because the language is bad, it’s because most of the developers don’t take the time to understand what it’s about.
- To make strong typing work, we need to define interfaces to specify what a function does, and then implement those interfaces.
- There are many ways to define interfaces, one being the Ester approach, which is good for small projects.
- Self-consistence is important, but it’s not easy to achieve.
- Consistency is what the Ester approach syndrome is all about, it’s a design pattern that helps in creating consistent code.
- To get rid of null usage in general, we need to use a null pattern object.
- Traits cannot be used for strong typing.
- The first step in strong typing is to define interfaces.
- Some developers use arrays to initialize, but it’s not consistent.
- The prediction of the other part is different from the prediction of the same.
- Improves are required for the types, especially when using functions.
- The number of projects that use interfaces is around 50%.
- The next step is to create a replacement for null that is an object.
- The order of classes and functions is important.
- Some developers use the “Status quo” approach, which is just doing things the way they’ve always been done.
- Some developers use the Ester approach.
- The presentation is important to show the results.
- For every function or method, we need to specify the type of the arguments and return types.
- There are some situations where we don’t need strong typing, like when we are sharing a function.
- The easiness of strong typing depends on the project.
- The level of understanding of the project is important.
- There are some important problems that we need to avoid.
- The most important thing is to have a clear understanding of the project.
- Some developers use the “Simple” approach, which is creating interfaces first.
- Some developers use the “Mock object” approach, which is creating objects that mock other objects.
- The first step in strong typing is to define interfaces and then implement those interfaces.
- Some developers use strings to initialize.
- The topological order of classes and functions is important.
- Some developers use the “Object” approach, which is creating objects that are used in the project.
- Some developers use the “Reference” approach, which is referencing the classes and functions in the project.
- The easiness of strong typing depends on the project.
- The level of understanding of the project is important.
- The the “Ester approach” is a good method for strong typing, as it works well for small projects.
- The topological order of classes and functions is important.
- Some developers use the “Composition” approach, which is using functions to compose other functions.
- The topological order of classes and functions is important.
- The prediction of the other part is different from the prediction of the same.
- The easiness of strong typing depends on the project.
- The level of understanding of the project is important.
- The topological order of classes and functions is important.