3 ms·
It's a PHP project. It shouldn't have typing, that's for playing make-belief of writing in Java for the framework-oo-enterprise world. Psr-2 is often not follow
by onli 3y ago
It's a PHP project. It shouldn't have typing, that's for playing make-belief of writing in Java for the framework-oo-enterprise world. Psr-2 is often not followed, even in really good projects. And the static analysis tools are of limited use for a small code base (though to use them and make using them easier would be a plus).
- smarkov 3y ago> It's a PHP project. It shouldn't have typing, that's for playing make-belief of writing in Java for the framework-oo-enterprise world. At least types are enforced at runtime. Wait until you learn about TypeScript.
- askonomm 3y agoYes it definitely should have types, as is the standard in the community nowadays. Types are definitely not make-belief, as they are checked during runtime, making them actual, real types. I'd say any real project (not a prototype) that has more than 1 person working on it should definitely make use of types so that everyone would know what the shape of the expected data is.
- onli 3y agoTypes are not make-belief, I know that :) I said using them in a php project is playing make-belief, it's a joke about php developers coding enterprise Java style (for php salaries ofc). Had nothing to do with how the language handles types when they are used.
- askonomm 3y agoThat's true, modern PHP is eerily similar to Java, though the enterprise-ness of it is just an indication of not-great developers overcomplicating things (both in Java and PHP). As far as salaries go though, there's some very low ones (WordPress etc) and some very high ones, like Java senior level salaries as well, but I guess Java itself doesn't have so very low ones, which brings the average Java salary much higher than PHP.
- hparadiz 3y agoThis is how I write my controllers these days. https://github.com/hparadiz/technexus/blob/release/src/Controllers/Admin.php https://github.com/hparadiz/technexus/blob/release/src/Contr... Strict types make things easier tbh.
- manbitesdog 3y agoAuthor here. I haven't made up my mind yet about whether types speed up or down the development in small projects, and I don't know if it defeats its purpose a bit. This is actually one of the open topics in the direction of oink.php: https://github.com/jcarlosroldan/oink/issues/3 https://github.com/jcarlosroldan/oink/issues/3
- onli 3y agoFwiw, please don't take my comment as a strong opinions against types in such a project. I just try not to judge projects negatively that decide not to use them, and I have a personal aversion to enterprisy code (whatever it is exactly), especially when it's heralded as the only true way, and even more especially if it overcomplicates formerly simple ecosystems, like what happened to parts of PHP.