5 ms·
Doesn’t this just highlight that php development ecosystem doesn’t value quality much? What even is a “file” in context of a web request? What about dependencie
by keymone 5y ago
Doesn’t this just highlight that php development ecosystem doesn’t value quality much? What even is a “file” in context of a web request? What about dependencies or logic defined in other files?
This is just bizarre, I can’t see a sane codebase where this would be preferable to going on GitHub and pressing “.”
- jbboehr 5y ago__FILE__ returns the path to the source file in which it's used. It's from C's equivalent preprocessor macro.
- chmod775 5y ago> Doesn’t this just highlight that php development ecosystem doesn’t value quality much? As opposed to which web development ecosystem exactly? The only web development ecosystem with overall decent quality software that I could come up with is Java, and their understanding of quality is... enterprise-y. Give me a mature PHP framework over a NPM dependency tree, python web framework, or ruby on rails any day. At least when looking for 'quality'. Relatively.
- wyclif 5y agoWhich PHP frameworks do you have in mind?
- yurishimo 5y agoLaravel, or any Symphony based framework is a great choice. PHP is a very modern and mature language at this point. If the first thing you think of is Wordpress, then you’re behind.
- keymone 5y agoAnd how relevant do you think highlight_file is for symphony or laravel?
- yurishimo 5y agoProbably none.
- andrewmackrodt 5y agoI agree with these points although going back to the grandparent comment, the value of being able to show the source code of a controller with these frameworks by appending a query string is close to zero.
- hn_throwaway_69 5y agoOn the contrary, doesn't it highlight that the PHP development ecosystem values simplicity? That is, a simple application (which this is) can be contained within one file, rather than something requiring several folders, dependencies, and an 'init' command? I don't understand your criticism and I suggest you might not either.
- keymone 5y agoThe irony of thinking files and folders are too much for simple app and also praising a feature that is in direct relation to php’s MO of conflating codebase folder structure with requests’ path. Edit: this reminds me, I was like this too at the beginning of my dev career, I also was completely in favor of this supposed “simplicity” of php, only much later, thanks to hickey’s nice talk I realized that I was confusing simplicity with ease. https://www.infoq.com/presentations/Simple-Made-Easy/ https://www.infoq.com/presentations/Simple-Made-Easy/
- deleted 5y ago[deleted]
- hn_throwaway_69 5y agoSorry, I don't understand your first point, even after reading it several times. I think I might have inferred what you meant by looking at the second (edited in) point, but I'm not sure. Are you suggesting that it is bad that PHP applications often have a request path that relates to the folder structure? In other words, are you suggesting that simplicity means an application should not have a request path that relates to the folder structure? To give an example, are you saying it's a bad thing that example.com/profile/ loads /profile/index.php, rather than passing /profile through a single controller function to identify what code should be responsible for handling it? The first approach actually seems pretty straightforward paradigm and it's what most new programmers would expect. Adopting a MVC/routes method is more complex and arguably overkill for a simple application. If that is what you are contending, it should be said that PHP does not require this approach. Although it is often a preferred approach, because it doesn't depend on additional web server configuration.