6 ms·
I blame the tools... Most tools and frameworks are designed from the ground up to be document-focused. Some even going as far as to purposely simulate a docume
by UnoriginalGuy 14y ago
I blame the tools...
Most tools and frameworks are designed from the ground up to be document-focused. Some even going as far as to purposely simulate a document when none exists (e.g. Tomcat).
Let's take PHP, ASP.net, and Java. They make up the majority of the internet right now. With RoR and MS MVC being outliers.
It is VERY hard to develop applications in them without a document focus because they use documents to direct functionality (e.g. logout.php and login.php might have different underlying functionality).
Now, yes, web-servers do support request redirection, so you can redirect from /logout to /logout.php, but such "magic" is time consuming because there is a disconnect between the underlying framework which "understands" pages and the dumb web-server which just does what it is told to do.
Even if you just automate it so you strip out the extension (e.g. strip ".php") you still wind up /thinking/ about things from a document perspective rather than a functionality perspective (e.g. "this functionality is on THIS page, this functionality is on THAT page").
We just need more modern frameworks where from the ground up the thing is based on a hierarchy rather than documents/files/etc. This should all be dictated by the framework, not the server's filesystem.
- greghinch 14y agoIsn't this what routing does? The problem you're describing seems to be primarily a PHP one, particularly with the lack of a dominant framework in the PHP community. (Possibly also a .Net one, I've avoided working with ASP like the plague in my career).
- zuppy 14y agoI don't think that's the case for PHP, at least not in the last 5-6 years or so... All the main frameworks (Symfony, Zend, etc) will force you to use the routing. It's not even possible without some work to call php files. Yes, I'm aware PHP allows you to create simple .php files, but that's not how the development is done these days.
- greghinch 14y agoAdmittedly, I've shied away from PHP projects over the past 4-5 years in favor of Python (Django) or server-side JS. I do still think the biggest hurdle PHP faces, at least when new devs come to it, is the lack of any one clear "best" framework. As you even mentioned, there are "main frameworks", but none of them is the clear "best" choice when you are approaching the language. In fact many people start building with PHP without a framework. Almost no one would start using Ruby to build a web app without choosing Rails. Similarly, no one would choose straight Python over using Django (waiting to get flamed by the Flask community here ;) ). With PHP, a lot of people choose it to build a "simple" web app, and end up just hacking together a few .php files. That was even more true 5+ years ago, and now there are a lot of legacy applications out there, that have grown quite large, still built on that principle.
- abraininavat 14y agoYeah, I don't think you've used RoR.
- UnoriginalGuy 14y agoI mentioned RoR and MS's MVC as two examples that do it "right." Was that unclear?
- abraininavat 14y agoYes, it was unclear, actually. Let's take PHP, ASP.net, and Java. They make up the majority of the internet right now. With RoR and MS MVC being outliers This sounds very much like you're calling RoR and MS MVC outliers with regard to the fraction of the internet they occupy. You're expecting me to know that your use of "outliers" was with respect to a quality not even mentioned in that particular paragraph, rather than with respect to the sentence right before it? Not to mention the fact that With RoR and MS MVC being outliers. is a sentence fragment, so the most obvious correction to your grammar would be to put it together with the preceding sentence. So, yes, you don't write very clearly, so I misunderstood you.
- itsybitsycoder 14y agoI thought it was clear enough. P2: Most tools are document-focused. P3: Some examples of these tools are XYZ. A & B are outliers. P4+: It is very hard to develop applications in "them" (the 'most tools' which are the topic of the comment) without a document focus, and here's some detail about that. It's not winning any writing awards, but it's not at all unintelligible. The organization of a piece of writing doesn't stop at the paragraph level, so to assume that the paragraphs are unrelated is pretty odd.
- phpnode 14y agoThese sound like complaints that would have been valid 10 years ago, but not any more. Virtually every framework has the concept of "routes" that map URLs to appropriate logic, they're not document based (whatever that means)
- throwawayG9 14y agoServer's filesystem? Are you serious? Welcome to 2013, all the problems you mention are long gone, and are only brought back from time to time by people like you who stopped learning a decade ago. You should check out symfony.com... Or any other framework for that matter! For Christ's sake.
- scarecrowbob 14y agoThis idea seems like a pretty normal way of seeing the world among PHP developers. Please allow me to vent/rant -- I'm finishing up a project where your comment resonates loudly with my frustrations. I'm a journeyman freelance programmer trying to move from doing WPress marketing sites more interesting programming/development problems, and I just got out of a 2 month Magento project (Magento is an MVC-patterned store software that is based on the Zend PHP framework): extending it to allow users to sign in and create their own product listings. This was my first time building MVC/OOP modules in the context of a framework, and it took a little bit to connect the OOP principles that I've studied to the actual implementation within the larger framework... but the last month has been like "WOW... I can finally see in a pragmatic way why OOP and MVC are both such a powerful tools!" Not to mention that, since we were working with extending the system, studying that stuff seemed like an essential learning process if we were going to create the system, even if I was only tasked with the "front-end" side of templates and visualizing the things from the database. However, the senior guy in charge of creating the functionality to manage products for users thought I was from mars-- his application, which was wholly separate from the Magento install and used a separate database, was patterned around directories, with a set of configuration and include files shoved into the head. He intend me to integrate his functions by shoving his (single, large) functions file into the head of (each of) my template files, and then calling functions to return arrays of information that I could then push into markup. Apparently, this is "the right and normal" way to do this stuff in the PHP world, and my process of writing modules, extending existing objects, creating routes to view the data through the framework's template system was all stupidly overcomplex. I learned a lot out of doing that, and the module that I'm building for another client (aMember/Zend) is both smooth and fun because all of the database interactions and template stuff is already in place and just works... and I can focus on the UI Javacript stuff... but I feel really badly for the project owner of the Magento project, as I feel the codebase is... well mostly a bunch of functions in a single file and a bunch of single-form .php files that make SOAP calls and depreciated mysqli_ calls... Now, I dunno-- I'm definitely the less experienced programmer, but if this is the norm in PHP programming (surely it can't be), I will be spending my summer trying to build enough projects in other languages that I can transition out of doing PHP. Sorry for the rant, but it was cathartic for me :D
- jeff303 14y ago"Java" - what specifically are you referring to? Spring MVC, as one example, has advanced routing capability and is in no way "forced document centric."