How to Review Code | Best Practices | Pull/Merge Requests | iOS | Swift | Checklist

  Переглядів 12,600

iCode

iCode

День тому

In this video, I have discussed about the things which we should keep in mind while reviewing the code (pull/merge request). Apart from this, I’ve also discussed about creating Pull/Merge requests, how to apply merge checks, best practices and compiled all the checks in an exhaustive checklist. Also, demonstrated each check with an example (by reviewing a dummy PR).
Checklist 👇🏼
gist.github.com/pallavtrivedi...
Chapters 👇🏼
00:00 Start
01:53 What’s there in the video.
02:16 Brief about demo project
03:34 How to apply merge checks
05:00 PR Creation
07:00 PR Review
07:58 Unnecessary Imports
08:15 Protocol Conformance in Extensions
09:25 Typo Checks
09:52 View should not have Data Object
10:25 Type Inference
11:46 Responsibility Division
12:00 Naming of the Variables
12:43 Single Responsibility - Different methods for different tasks.
13:10 Unnecessary Checks
14:40 Consider edge cases (keep fallbacks) - Error Handling
15:30 Write code for maintainer
16:24 Hard Coded Values
17:24 Prefer Enums, Switch over if/else
18:30 Use APIs provided by Apple
19:20 Check for Force Unwraps (Prefer Optional Binding)
20:02 Check for Indentations
20:50 Check for efficient Memory Managment (avoid retain cycles)
21:26 Avoid using deprecated APIs
21:56 Dependencies should be injected
23:03 DRY (Don’t Repeat Yourself)
24:08 Prefer Higher Order Functions
25:35 YAGNI Principle (You Aren’t Gonna Need It)
27:33 Early Returns wherever possible
28:15 Check Array’s count before accessing the elements
29:09 ViewModel Should Only Have Business Logic
29:31 Unintended Changes
31:00 Boy-Scout Principle
32:55 Code Review Checklist

КОМЕНТАРІ: 57
@JonatanEdOrtiz
@JonatanEdOrtiz Рік тому
I believe it's good practice to also explain the reason for requesting the change in each comment, that way more junior devs can learn new concepts and apply them to their future code.
@odiadavid6957
@odiadavid6957 Рік тому
When given code reviews as a Senior or team member, it’s generally good practice to include sample code snippets along with your feedback. Simply pointing out poor practices is half the journey.😊
@JonatanEdOrtiz
@JonatanEdOrtiz Рік тому
Exactly
@archanabhosale5101
@archanabhosale5101 Рік тому
I was looking for one proper process for code review and you have given exactly that. Thanks for your inputs.
@sunnysinha4724
@sunnysinha4724 Рік тому
I love the way you explain. Generally we forgot most of the point while coding but the way you explained every point with an example will remain in mind. Thanks a lot. Will expect more interesting content from you😊
@trade_o_mania
@trade_o_mania Рік тому
Hi Pallav, It is great that you provide extreme information free of cost. First of all Love from the heart brother. I follows you for the last month only. I have learned lots of things from you and I'm trying to implement them in real client projects. I have created many demos to be a better Sr. iOS Developer, but I was struggling. After checking every single video, I can see improvement. Your style of passing information is very easy and simple to understand complex things. Please create a video on a learning path. Like where to start, what to learn, and how to learn. Because every developer missed this path and was stuck between multiple topics.
@TechRagh
@TechRagh 2 роки тому
Thanks Pallav, please keep posting more and help us to learn more 😊
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Sure 🙂
@ViktorMameshyn
@ViktorMameshyn 2 роки тому
Great suggestions, Pallav! Thanks for the useful video, I'll definitely keep watching your next issues :)
@sarikapaghdal6150
@sarikapaghdal6150 Рік тому
very well explained! Thank you!
@KimbrellBrad
@KimbrellBrad Рік тому
Great list! I have not been exposed to CR but wanted to ask someone to take a look. Now I can be ready to look at their code as well. Thanks for the tips!
@pushpabisht4850
@pushpabisht4850 2 роки тому
Very much useful, thanks a lot Pallav for this video.
@dhivyavenkatachalam7724
@dhivyavenkatachalam7724 Рік тому
Really great tips!
@kishorekankata9369
@kishorekankata9369 2 роки тому
Awesome video. Kudossss!
@RahulKumar-hr2gq
@RahulKumar-hr2gq 2 роки тому
Sir please keep going. You are helping a lot of people(Developers) to gain free of cost very information knowledge. :)
@saurabhsierra9195
@saurabhsierra9195 2 роки тому
Yeah... that's right ...even the smallest mistake breaks the code...i was really searching for something that can help mitigate the same ...thanks for the same again ....once again Awesome tricks to mitigate the code gulping mistake .
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Glad that you found the video useful. Thanks 🙂
@rishitprajapati6753
@rishitprajapati6753 2 роки тому
very useful video , Thanks
@rajasekarangopal5372
@rajasekarangopal5372 2 роки тому
Thanks Pallav. it was very informative.Keep inspiring US 👍🏻
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Glad that you found it useful 🙂
@rehanismail7082
@rehanismail7082 2 роки тому
It’s Best tutorial. I ever found related to Code Review learning. Keep it up bro waiting for your next tutorial.👍
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Glad to hear that Rehan. Thanks for your support 🙂
@alex_und3r
@alex_und3r Рік тому
nice video bro! u got my subscription!
@krishnendramishra89
@krishnendramishra89 2 роки тому
Your series are always have some unique content ... Thanks for making unique content for iOS developers.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks Krishnendra 🙂
@polu9132
@polu9132 2 роки тому
Class as always. Thank You Sir.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks 🙂
@tariqul_wwwh
@tariqul_wwwh 2 роки тому
One of the best video
@gouravmandliya5181
@gouravmandliya5181 2 роки тому
Just subscribed, nice work👍
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Glad that you liked the videos 🙂
@sakirsaiyed49
@sakirsaiyed49 2 роки тому
Very good observations... keep it up. nice content.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks you Sakir 🙂
@rehanismail7082
@rehanismail7082 2 роки тому
Thanks Bro
@Rahul-jf5kf
@Rahul-jf5kf 2 роки тому
Nice video Pallav, with step by step explanation. Can you make video on iOS app UI Design using storyboard or share some links for UI Design. also please make video on storyborad code review.
@deveshtyagi
@deveshtyagi 2 роки тому
Quality content 🔥🔥🔥
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks Devesh 🙂
@abdulr6511
@abdulr6511 2 роки тому
Best Video Ever
@JLCodes
@JLCodes Рік тому
at 8:15 of this video, you mentioned to check if there are any unnecessary imports. `Foundation` is unnecessary when `UIKit` is imported already since UIKit contains Foundation.
@tokero5199
@tokero5199 8 місяців тому
Was expecting this comment, for some reason there is always someone pointing this out. I dont really see the issue here since UIKit depends on Foundation, Foundation will still be there and there is no overhead in making this explicit, the real issue would be to import something that is not used. In a UIViewController that has a WKWebView would you remove the "import UIKit" statement because UIKit (and Foundation) is transient dependencies of the "import WebKit" statement? I would definitely not do that since it would be more confusing than helpful.
@shmalesmal8692
@shmalesmal8692 Рік тому
great and clear explanation! thanks for sharing this. greetings from Ukraine!
@Jock3R87
@Jock3R87 2 роки тому
Hey Pallav.. thanks for video first… Appreciate your efforts. One query .. at the start you gave comment 10:18 .. how can VM send the data to VC if not allowed to to declare such thing
@buba7456
@buba7456 2 роки тому
Super video
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks 🙂
@victorriurean
@victorriurean Рік тому
nice
@HumbleHustle101
@HumbleHustle101 2 роки тому
Good video. I think returning tuple from a method does not promote readability rather a struct should be returned.
@krishnakirana8399
@krishnakirana8399 2 роки тому
Is there any option to check the major storyboard/XIB changes?
@maniios7446
@maniios7446 Рік тому
Great videos, REG:- type inference point, 1)var name = "iCode" -> is compiler taking time more 2)var name : String? = ""iCode""-> is compiler taking time less 3)var name : String! = "iCode"- > is compiler taking time less in 2 and 3 which one is take more to compiler ?? . Please post any video of closures..Thanks in advance
@UK-lp7no
@UK-lp7no 2 роки тому
Awesome tips, good learning progress with your videos! I have some questions, Pallav. I hope you can answer those. I didnt' get the part, how the data received from API in VM? Should we make the API calls from VM and return the model to VC? How about, on best directory structure? For example, Should we keep the models under MVVM folder/module, or create a different folder for Network layer and keep them there as Request/Response models? Lastly, this is not direct related to this video but do you have any video on working with legacy code (ObjC) in Swift project? Especially, i heard this Adapter pattern that converts Swift objects to be directly used in ObjC classes or vice versa, without needing additional marks in class itself but in Adapter. I think, it will be awesome to watch an implementation video from you.
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
I'm glad that you are liking my videos. Regarding your questions - - I didnt' get the part, how the data received from API in VM? Should we make the API calls from VM and return the model to VC? View Model is calling method of Network Manager, which is handling web service calls. It returns the model to View Model. For communication between controller and view model, I'm not passing the model to view, instead, observing the changes on that model using Combine. If you haven't watched my videos on MVVM and Combine, please do. I've explained this there. - How about, on best directory structure? For example, Should we keep the models under MVVM folder/module, or create a different folder for Network layer and keep them there as Request/Response models? The kind of structure that I prefer is - Module Directory (say Profile) -> 3 directories at Same Level (View, Model, ViewModel). Inside View you can have directory for cells. If you are having different network configuration for each module, you can have a directory for network to (at the same level). But yeah, root should be for module, and then M, V, VM. It is more manageable (still, personal preference 😅) For your last point, I'm not having any video/project showing adapter, or bridging between Objc and Swift projects. I'll try to cover it. Thanks 🙂
@UK-lp7no
@UK-lp7no 2 роки тому
@@iCode_Happy_Coding Thanks for answering my questions. I'll look forward to your design pattern videos, especially Adapter. All the best :)
@Vinay-xd7du
@Vinay-xd7du 2 роки тому
Please make a video on complete App Architecture in Swift UI..like how to separate and communicate Model,Network,VewModel,UI Layers for any kind of application
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
Thanks for the suggestion Vinay. I’ll try covering it 🙂
@Vinay-xd7du
@Vinay-xd7du 2 роки тому
Eagerly waiting for this video..thank you..Out of all iOS videos in UKposts Your videos are so clearly explained, unique and practically useful for any iOS dev..you will grow for sure..Keep uploading the videos..All the best!!!
@suryakantsharma6761
@suryakantsharma6761 2 роки тому
Awesome Content Pallav. Why you stop posting new content now a days ? All Good.
@nitinbhatia493
@nitinbhatia493 Рік тому
Create a tutorial on CI/CD please.
@pankajkainthla
@pankajkainthla 2 роки тому
How code review is done by just reading the code? Dont we have to checkout it build run and test the feature before approving .
@iCode_Happy_Coding
@iCode_Happy_Coding 2 роки тому
So to solve this issue, there's a practice that we follow "Feature Level Approval by QA". A PR is not merged until it has x number of developer approvals and y number of QA approvals. X and Y can vary depending on team/feature size, but atleast 1 QA approval is required for PR to be merged. That assures that feature is working as expected, while code quality is evaluated by PR review.
Improve Debugging Skills | iOS | Swift/Obj C | Xcode
26:02
iCode
Переглядів 16 тис.
ДРУГА РЕПЕТИЦІЯ alyona alyona та Jerry Heil на сцені Євробачення-2024
00:34
Євробачення Україна | Eurovision Ukraine official
Переглядів 138 тис.
Design Patterns | Factory Design Pattern | What, Why and How
14:53
You might not need useEffect() ...
21:45
Academind
Переглядів 123 тис.
Inheritance vs Interfaces (Protocols) In Swift
18:43
iCode
Переглядів 13 тис.
How to make a pull request on an open source project
16:57
Web Dev Cody
Переглядів 66 тис.
github gave me a BEAST for coding 🤯 NO MORE VS Code
8:20
Alex Ziskind
Переглядів 701 тис.
iOS Dev Vs. Web Dev - My Thoughts After Building My First iOS App
3:54
Your Average Tech Bro
Переглядів 58 тис.
iOS Interview Questions #1 [Swift 5 | 2021]
10:30
Aryaman Sharda
Переглядів 18 тис.
ДРУГА РЕПЕТИЦІЯ alyona alyona та Jerry Heil на сцені Євробачення-2024
00:34
Євробачення Україна | Eurovision Ukraine official
Переглядів 138 тис.