4 ms·
I have no idea how starting with <?php in a file is relevant. Should we also start mocking languages that expect a given file extension?
by preinheimer 11y ago
I have no idea how starting with <?php in a file is relevant. Should we also start mocking languages that expect a given file extension?
- aikah 11y agoMy point is that PHP renders text first and foremost, writing code in PHP is "opt-in" somehow. An HTML file for instance is a valid PHP file. AFAIK an HTML file isn't a valid Ruby or Python file. You don't need to tell the interpreter to kick in at first place. But that's not the main idea I tried to convey in my comment.
- gemma 11y agoRight, your comment argued that "view logic, domain/business logic and database boilerplate code intermixed in a single file" is not "ancient history in the PHP world". Which it is, regardless of the `<?php` tag at the top of all the files. How a source file is processed has no impact on how programmers choose to model their applications.
- mercer 11y agoTheoretically no, perhaps, but practically I think there is an impact. I can't dump html into a .rb or .js file, so I'm less likely to do so as a beginner. On the other hand, starting out with php, that seemed like the logical thing to do. Because I could.
- recursive 11y agoBecause it demonstrates that that pattern does not follow the default mode of operation for the language.