Это видео недоступно.
Сожалеем об этом.
You Don't Need to Know Design Patterns or SOLID Principles
HTML-код
- Опубликовано: 3 ноя 2022
- Controversial title, but let me explain what I mean by that. The key moment is "to know".
- - - - -
Support the channel by checking out my products:
- My Laravel courses: laraveldaily.com/courses
- Laravel QuickAdminPanel: quickadminpanel.com
- Livewire Kit Components: livewirekit.com
- - - - -
Other places to follow:
- My weekly Laravel newsletter: us11.campaign-archive.com/hom...
- My personal Twitter: / povilaskorop
When I started learning SOLID I realized that half of the principles I already had used in my code before. Yes, Povilas is right, when you are involved in many projects, over time, you want to write code in a way that is closer to Design Patterns and SOLID principles.
I think it’s fine to learn SOLID and design patterns. But with practice and experience you find your own ways but have the theory of what you learned. Just like when you learn to drive a car 😅
As someone with no formal training I always feel pleased when I learn a principle and realise I do it already!
This!!!
We need to show this video to all these HRs who think it's a mandatory question in every interview to ask about the SOLID Principles and expect you to memorize every one and its explanation
I'm now mentoring some developers and have come to realise that knowing the theory is much more important than I thought it was.
I have more than 27 years of experience in programming and i totally agree with you.
I think it's good to know SOLID and design patterns, especially Strategy/Factory. SOLID allows you to competently design large and complex projects making the code understandable and easily extensible
When you learn design patterns, You will try to use them everywhere at the beginning :D
I had this problem myself.
Yes, the best example of overengineering :)
i remember first starting out programming 10 years ago and learning about DRY (do not repeat yourself). today, i often opt to repeat myself because all my "DRY" code ended up looking like a horrific frankenstein and an absolute nightmare to maintain
This is a very good lesson for people who are too concerned about Design Patterns and SOLID Principles. Those are not like religion. I may read and even memorize those. But the wrong use of those may make the code more complex! Reading and contextual thinking about those may be effective who have better ideas about the "domain of the problem and the big picture".
I completely agree with you, but in the big companies that I had an interview with one of them recently, they only focused on these things.
It is good to know desihn patterns so that we can apply them when we need them.
SOLID principles are for me important, because they are really beneficial for the whole team.
If we learn or recall them in order to use them at all costs, it is absolutely the wrong approach.
For example, I always look for a pattern when:
1. When the code is intended to be extended without much effort by a subsequent developer.
2. The functionality needs to be extended and would pose a risk to code readability/extensibility in the future.
I think we should know about these things not in order to memorise them but to raise awareness. One more thing. many of think that we are writing good code until. we read some book about code design and architecture. Especially the junior developers who are the the threshold of becoming more than junior. Me personally I became much more versatile once I became familiar with these techniques.
I agree! Learning from practice is much more applicable for the real life problems. Laravel structure and documentation and other Laravel packages are a great source of practical knowledge. Besides that, lessons from great teachers like Povilas or Jeffrey Way are incredibly valuable and applicable to real life.
Whereas, if you learn SOLID, you will usually wait for 6 months to implement something in your project or you will likely implement it in a wrong place. (Duplication is cheaper than a wrong abstraction!)
You're right. Some are better at practical than theoretical, which is why I find theoretical interviews very hard.
Yes, your explanation is very logical. but many times some job opportunities make it clear that a programmer with knowledge of design patterns is needed.
Agreed. I didn't need to know many design patterns when working with Laravel since Laravel handles those under the hood or walks you through intended usage through great documentation. However, when moving away from Laravel to a microframework and code bases without a framework, I had to deepen my knowledge of SOLID principles and design patterns.
The concept of SOLID code & Design Patterns are always intimidating to me. Don't know why, but they scare the shit out of me!
Thank you for this informative video
You should know the principles, it s important to explore those ideas especially when you are a beginner, they will give you important insight
I think what he means is to at least get the basics of the SOLID, you don't need to memorize everything, just get what you need adopt it. and then revise it to fit what you needs
I have a new question. When dealing with application settings that you want a UI for, such as meta data, feature toggles, user limits, can you write directly to a config file, or do you have to utilize a database with key value pairs? And what is the ideal way to save unknown keys that may have different datatypes as values?
There's no one way or ideal way, you choose yourself how you want to deal with it. There are also packages, google "spatie settings".
The problem is that the people from human resources (because they have no idea what it means to write code) always introduce questions about Design Patterns and SOLID in the interview.
If they have no idea how to write code, you may provide any answers to their questions and they would believe you :)
Seeing other peopel's code is tricky business, you can copy / learn bad practices too
Last time watched one of your video!
Doing Great work. Here is question: If request()->validate() fails it redirect to previous page. how to redirect to specific part of the page withfragment.
Here's the link to the official docs: laravel.com/docs/9.x/validation#customizing-the-redirect-location
@@LaravelDaily It's for seprate class Formrequest. I'm using in controller function with this request()->validate().
Amazing video ❤️ Well explained
Could you shoot some videos about Laravel with websockets/broadcast system? I can't understand why Laravel docs only uses Laravel Echo and Pusher, basically. And why you can't send client events to the Laravel app, only from Laravel the client.
I'm planning a course about websockets in 2023, if all goes according to the plan
Thank you for the video sir.
anyway, what do you think about applying the repository pattern in laravel?
I have a few videos about it, search the channel. In short I'm against it.
ow to add table footer for filament? please
that's right, 100% all hands with you, best coder is not who knows too much smart words)
SOLID principles are meant to be known not because they are "famous", but to literally save the junior developer (and especially his senior colleagues) time to refactor the code each time new feature is built. But it's not by knowing principles - it should be about knowing how to use them in every new feature.
It's technically true, but you're doing yourself a disservice if you don't at least familiarize yourself with them.
Common sense pattern > Design patterns
Very well said!
for my personal opinion , we dont always need to use Solid principles and design patterns but we should at least know what they are .
We should mention that, it will be impossible to find a job without theory knowledge
Not sure, worked for me for 20 years.
@@LaravelDaily I would also mention that, every person is different, what for Einstein was common sense, for other people dark forest, It helped me not to use them but question more often is my code optimal and scalable
wise words
I'm the first to view your video today sir
But in the other hand, if you are not able to understand and memorise 5 simple rules maybe the software development is not your job.
Just searching for that
Recently been seeing filament code and trying to understand how someone can something like that and how it hijacks the routes, lool and not able to understand it made me feel so dumb
I completely disagree with you. Every oop developer should know them very well. How can you use something you don't know. Yes if you are junior don't have to know, but to get to more experienced level you Should master them
I disagree, design patterns and SOLID principles are about establishing a common language between developers, so that when you're working on a feature with a colleague and he suggests making something a singleton, you immediately know what he means by that instead of being verbose about it by saying "let's make a class that can only has one instance that lives throughout the whole program's lifecycle".
When you're debugging an issue with someone and you tell him that a class is breaking Liskov principle, they immediately know what you mean.
Knowing these patterns and principles is *essential* when working on serious, well-written projects with a team. Otherwise, yes, learning them by names is not needed to become a good developer when you're developing on your own and you're not at a company or collaborating with others on open source projects, as you said, almost every developer has probably used these patterns and principles without even realizing it, and that's only good enough when you're working on your own :)
Edit: It's ALSO important to understand that these patterns and principles are not gospel that must be followed to a T, many principles like Singleton can oftentimes be considered an anti-pattern when misused.
And when you do know SOLID and design patterns you know how terrible eloquent is.
Please don't tell me that. I am currently studying SOLID .(
It would still be beneficial! Just maybe not as fundamental as you would think. But depends on what projects you're working on.
I love you man, but your tutorials are a GAB between junior and senior
I don't agree.