4 ms·
I haven't used PHP for almost a decade, but I agree with the sentiment of this article. I built a web app back in 2009 in PHP and didn't use Code Igniter or Ze
by dvt 9y ago
I haven't used PHP for almost a decade, but I agree with the sentiment of this article.
I built a web app back in 2009 in PHP and didn't use Code Igniter or Zend (basically the only two frameworks back then), opting to do it all by hand. And it ended up being a really valuable and formative experience. No matter what language I use, I understand how a web application really "fits together" under the hood and I think there's value there.
As a side-note, compared to Node.js or Rust or what-have-you, PHP just seems needlessly verbose.
- deleted 9y ago[deleted]
- halfjoking 9y agoI'm someone who uses a custom framework at work, and it's not verbose at all. Maybe I'm doing it wrong? I just spl_autoload_register on a controllers directory. Then based on the url, it creates a class for the first part of the url and passes in the rest... $class = new $class_name(); $class->index($url_parts); That class always extends an output class which uses a template system to render a component. I also use an ORM with a models folder that has a bunch of static functions to get data in each model class. I would love to hear from someone more knowledgable about the disadvantages of my approach or why this articles is a better way of doing it. Of course I use composer and use a bunch of libraries for aws, oauth, Google APIs... but for the actual framework I keep it simple and haven't had problems so far.
- dvt 9y ago> I'm someone who uses a custom framework at work, and it's not verbose at all. Maybe I'm doing it wrong? Probably, not, it was just my sentiment by looking over the code in the article :) I haven't used PHP for almost 10 years, so I have no inkling of what "modern" PHP looks like.
- fein 9y agoSymfony 4 looks and feels like a slightly odd java Spring setup. Annotations are ugly as hell in PHP but thats a result of not having annotations supported in the language itself (you need an annotations preprocessor and they're all in comment blocks). There is an rfc for annotations in php as a language feature, so maybe someday. When that happens, Symfony may as well be Spring for PHP.
- clairity 9y ago> "...Code Igniter or Zend (basically the only two frameworks back then)..." wat?! i coded php in the early/mid 2000's and had at least a half dozen frameworks available to choose from even then. for example, i used fusebox after starting to create my own framework and finding that it already (mostly) did what i had wanted to do.
- deleted 9y ago[deleted]