Settling the File Structure Debate
– muhammedsari.me - submitted by Muhammed Sari
Group by type or context / process? One of these methods will crush your project's growth. Find out which!
Read more [muhammedsari.me]
– muhammedsari.me - submitted by Muhammed Sari
Group by type or context / process? One of these methods will crush your project's growth. Find out which!
Read more [muhammedsari.me]
– hakanaktas.com.tr - submitted by Hakan
A pragmatic approach to avoiding early optimizations
Read more [hakanaktas.com.tr]
Join thousands of developers
Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.
No spam. Unsubscribe anytime. You can also follow me on X.
– medium.com - submitted by CODE AXION
I have described where to put your scopes if your model is cluttered with 10 + scopes
Read more [medium.com]
Anna Filina shares how she goes about organizing small functions.
Read more [afilina.com]
It's funny how from the outside, IT is often seen as an exact science. When starting as a developer, I often heard people say: "Oh, you're in IT, so you must be good at mathematics". I never understood why someone who is supposedly good at mathematics is the right person to fix a printer.
When you have some experience building applications, you know that IT is not an exact science. There are multiple valid solutions to a problem. Take five developers and ask them what the best way to set up a blog is. You'll likely get five different answers. Each suggestion will have its own set of tradeoffs.
– liamhammett.com - submitted by Liam Hammett
Some tips when dealing with lots of macros in Laravel, and composing them into mixin classes elegantly.
Read more [liamhammett.com]
A couple of days ago my colleague Brent published a blogpost on Domain Oriented Laravel. In short, he makes the case for organising your code around business concepts or features. That might sound very "heavy" or daunting, but it's actually for easy to get started with.
In this short video I explain how you can use PhpStorm to refactor your code. Make up your own mind if you need this in your projects.
I don't necessarly agree with every detail in this post, but it's very interesting to see how others structure larger projects.
In this article, I would like to show you an alternative way to organize your Laravel directory structure. I think the default structure is fine for the most projects. But when it comes down to larger projects I was looking for a different structure.
Read more [stefanbauer.me]
My colleague Brent shares how we've been structuring our non-trivial projects at Spatie.
In this post we'll look at a different approach of structuring large code bases into separate domains. The name "domain" is derived from the popular paradigm DDD, or also: domain driven design.
Read more [stitcher.io]
In an older but still relevant article on the Clean Coder Blog, Uncle Bob argues that the structure of your tests should not necessarly reflect the structure of your code.
The structure of the tests must not reflect the structure of the production code, because that much coupling makes the system fragile and obstructs refactoring. Rather, the structure of the tests must be independently designed so as to minimize the coupling to the production code.
Read more [blog.cleancoder.com]
Rémi Collin shares a cool approach on where to place code that doesn't really belong in a controller. He creates small, reusable, testable, decoratable classes, called Actions.
Using this approach can seems a lot of classes at first. And, of course the user registration is a simple example aimed to keep the reading short and clear. Real value starts to become clear once the complexity starts growing, because you know your code is in one place, and the boundaries are clearly defined.
Read more [medium.com]
At this year's Laracon US Adam Wathan gave a talk titled "Cruddy By Design" on how to structure your controllers better. After the conference he published a new GitHub repo that contains the demo app he refactored on stage. The 4 main tips to improve your code come as PRs on the repo with a full description on why the change is valuable. Very cool stuff.
Using this convention as a "rule" is a good way to force yourself to keep your controllers from becoming bloated, and can often lead to learning interesting new things about your domain.For the presentation, I put together a demo app called "CastHacker" that showcases podcasts about software development. It's not a "real" app by any means (lots of imaginary features, no tests, etc.); it's just enough code to demonstrate the concepts from the presentation. Feel free to clone it and play with it locally if you like though.
I've written up each refactoring I shared in the presentation as a detailed pull request.