Junior Code Review: Cache, N+1 Queries and "Messy" Code

  Рет қаралды 5,852

Laravel Daily

Laravel Daily

Күн бұрын

Пікірлер
@satishksharma
@satishksharma Ай бұрын
Thank you for reviewing my code and giving your precious advice. I will care on it.
@tiborkovacs198
@tiborkovacs198 Ай бұрын
I’m an aspiring junior developer who just finished my studies and am focusing on the Laravel + Inertia + Vue.js stack. I've learned so much from your videos-thank you very much! I really appreciate your junior code reviews.
@minthantoo3509
@minthantoo3509 Ай бұрын
Was waiting for your video all week long. Happy 40.
@kemal6039
@kemal6039 Ай бұрын
Great video as always. One thing about using @class directive, I'm using vscode and it doesn't autocomplete tailwind classes when it's inside the @class directive. And it sometimes can be annoying to type all the classes by hand. That might be why they went with that approach. To work around this, I give the classes in default html class attribute and then move it into @class directive. I can suggest this approach in case anyone else finds it annoying.
@adilomer7415
@adilomer7415 Ай бұрын
One of the things I learned from you a few months ago is the importance of including a README file and other stuff. I’m currently working on a project, and once it’s done, I’d like to have you review my project if possible so I can keep improving my skills for future projects.
@LaravelDaily
@LaravelDaily Ай бұрын
Sure, if I have more free time then, and if it's valuable for others. And you would probably need to wait for at least a few weeks for the review. Email me povilas@laraveldaily.com then.
@odehadejoh9966
@odehadejoh9966 Ай бұрын
I completely agree that the balance could have been calculated in the query. But a lot of the time, I see that programmers only want to use SQL to fetch data, forgetting that it can also transform data as required.
@ranostaj-dev
@ranostaj-dev Ай бұрын
Good tips, regarding the SQL performance I rather use Query Builder than Eloquent Relations, especially in this scenario this could be a better option and such a list could be written using one Query
@ЖеняХристенко-е3ы
@ЖеняХристенко-е3ы Ай бұрын
Thank you! Great, it is helpful for me!
@373323
@373323 Ай бұрын
awesome review, very interesting and educational
@atiqurrahmanme
@atiqurrahmanme Ай бұрын
Hey Povilas, Thanks for your video! I've been following your tutorials since 2019, and they've helped me a lot in improving code quality and optimization. If possible, could you please make a video on when developers should use raw queries versus Eloquent? While reviewing junior developers' code, I noticed they often mix raw queries with Eloquent without knowing when each approach is appropriate or what the best practices are.
@krekas
@krekas Ай бұрын
When you can't get the result without basic eloquent features, then use raw. I think it's simple as that.
@LaravelDaily
@LaravelDaily Ай бұрын
There's no one-size-fits-all advice. I guess it's preferable to use Eloquent, then in some cases you may switch to Query Builder (search my video on "whereHas vs Join"), and if that doesn't work, THEN you try to switch to Raw. But this is mostly my personal opinion, other devs may have different perspective.
@atiqurrahmanme
@atiqurrahmanme Ай бұрын
@@krekas I know, but some cases they use raw queries where it's possible to use eloquent or DB queries. However, for the complex reports, sometimes it's better to use raw query instead eloquent.
@krekas
@krekas Ай бұрын
@mdatiqurrahman2561 for reports, you might need a lot of sql functions to get data like min, max, avg, etc. Then, without raw I don't think it's possible
@marcelaodev
@marcelaodev Ай бұрын
Great content!
@LoganathanNatarajanlogudotcom
@LoganathanNatarajanlogudotcom Ай бұрын
Thank you!
@marcelaodev
@marcelaodev Ай бұрын
I assume there was no tests. A very simple test would have catch the factory issue.
@LaravelDaily
@LaravelDaily Ай бұрын
Nope, no tests.
@earavichandran
@earavichandran Ай бұрын
Sir, is it possible to seed a particular table data in Database seeder? I mean, for example, i have subject table with some specific subjects and students table with student data like name regulation semester etc... When i run db:seed , i need to populate the student data and subject data (not random fake data) Is it possible? Apologize me i my question is wrong... Thank you.
@felixmensahafedzo70
@felixmensahafedzo70 Ай бұрын
It's totally possible. I do something similar by seeding the data from a JSON file.
@earavichandran
@earavichandran Ай бұрын
@felixmensahafedzo70 Thank you for your valuable suggestions 🙏🙏
@felixmensahafedzo70
@felixmensahafedzo70 Ай бұрын
​@@earavichandran You're welcome
@LaravelDaily
@LaravelDaily Ай бұрын
Yes it's surely possible, you don't have to seed fake data, you can get it from any source you want, like your own database or external files.
@earavichandran
@earavichandran Ай бұрын
@LaravelDaily Thank you for the valuable information sir
@trexlm
@trexlm Ай бұрын
Nice video, thanks :)
@iamriwash7943
@iamriwash7943 Ай бұрын
can u make video about stored procedure with laravel
@LaravelDaily
@LaravelDaily Ай бұрын
I don't really use stored procedures so I can't make a video, sorry
@chikugerson5291
@chikugerson5291 Ай бұрын
​ @LaravelDaily on the N+1 queries whats the ideal number of queries that should be made to a DB so as to know when the queries are well optimized...I might have missed it
@LaravelDaily
@LaravelDaily Ай бұрын
There's no specific number, depending on the page. The lower, the better.
Junior Code Review: 5 Tips for Over-Engineered Example
12:51
Laravel Daily
Рет қаралды 6 М.
Writing Pest Tests for Laravel CRUD: Live-Coding
18:55
Laravel Daily
Рет қаралды 6 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Why Don't We Have A Laravel For JavaScript?
12:36
Theo - t3․gg
Рет қаралды 112 М.
go is great i hate it
14:44
SST
Рет қаралды 19 М.
Turning bad React code into senior React code
13:10
Cosden Solutions
Рет қаралды 94 М.
Need animations? Use this library.
12:24
Theo - t3․gg
Рет қаралды 72 М.
4 Problems with Eloquent Soft Deletes (and Two Alternatives)
9:05
Laravel Daily
Рет қаралды 13 М.
Dependency Injection | Prime Reacts
28:34
ThePrimeTime
Рет қаралды 361 М.
Laravel Mini CRM for Beginners in 1 Hour: Step-by-Step
1:12:57
Laravel Daily
Рет қаралды 15 М.
Windsurf vs Cursor: In-Depth AI Code Editor Comparison
18:14
Yifan - Beyond the Hype
Рет қаралды 18 М.
All Rust features explained
21:30
Let's Get Rusty
Рет қаралды 329 М.
Laravel Roles/Permissions: Complex Multi-Clinic Project
13:03
Laravel Daily
Рет қаралды 11 М.