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

Поделиться
HTML-код
  • Опубликовано: 10 июл 2024
  • 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 Год назад +3

    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 Год назад +6

    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.😊

  • @archanabhosale5101
    @archanabhosale5101 Год назад +2

    I was looking for one proper process for code review and you have given exactly that. Thanks for your inputs.

  • @sunnysinha4724
    @sunnysinha4724 Год назад +4

    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😊

  • @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!

  • @dhivyavenkatachalam7724
    @dhivyavenkatachalam7724 Год назад

    Really great tips!

  • @TechRagh
    @TechRagh 2 года назад +3

    Thanks Pallav, please keep posting more and help us to learn more 😊

  • @pushpabisht4850
    @pushpabisht4850 2 года назад

    Very much useful, thanks a lot Pallav for this video.

  • @kishorekankata9369
    @kishorekankata9369 2 года назад

    Awesome video. Kudossss!

  • @rishitprajapati6753
    @rishitprajapati6753 2 года назад

    very useful video , Thanks

  • @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. :)

  • @KimbrellBrad
    @KimbrellBrad 2 года назад

    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!

  • @price_action_wale_baba
    @price_action_wale_baba Год назад +1

    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.

  • @krishnendramishra89
    @krishnendramishra89 2 года назад +2

    Your series are always have some unique content ... Thanks for making unique content for iOS developers.

  • @alex_und3r
    @alex_und3r Год назад

    nice video bro! u got my subscription!

  • @rehanismail7082
    @rehanismail7082 2 года назад +1

    It’s Best tutorial. I ever found related to Code Review learning. Keep it up bro waiting for your next tutorial.👍

  • @tariqul_wwwh
    @tariqul_wwwh 2 года назад

    One of the best video

  • @rajasekarangopal5372
    @rajasekarangopal5372 2 года назад

    Thanks Pallav. it was very informative.Keep inspiring US 👍🏻

  • @polu9132
    @polu9132 2 года назад +1

    Class as always. Thank You Sir.

  • @saurabhsierra9195
    @saurabhsierra9195 2 года назад +3

    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 .

  • @shmalesmal8692
    @shmalesmal8692 2 года назад

    great and clear explanation! thanks for sharing this. greetings from Ukraine!

  • @sakirsaiyed49
    @sakirsaiyed49 2 года назад

    Very good observations... keep it up. nice content.

  • @gouravmandliya5181
    @gouravmandliya5181 2 года назад

    Just subscribed, nice work👍

  • @deveshtyagi
    @deveshtyagi 2 года назад +1

    Quality content 🔥🔥🔥

  • @abdulr6511
    @abdulr6511 2 года назад

    Best Video Ever

  • @rehanismail7082
    @rehanismail7082 2 года назад +1

    Thanks Bro

  • @buba7456
    @buba7456 2 года назад

    Super video

  • @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.

  • @victorriurean
    @victorriurean 2 года назад

    nice

  • @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

  • @JLCodes
    @JLCodes Год назад +2

    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 11 месяцев назад

      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.

  • @krishnakirana8399
    @krishnakirana8399 2 года назад

    Is there any option to check the major storyboard/XIB changes?

  • @HumbleHustle101
    @HumbleHustle101 2 года назад

    Good video. I think returning tuple from a method does not promote readability rather a struct should be returned.

  • @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 года назад +1

      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 года назад +1

      @@iCode_Happy_Coding Thanks for answering my questions. I'll look forward to your design pattern videos, especially Adapter. All the best :)

  • @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

  • @suryakantsharma6761
    @suryakantsharma6761 2 года назад

    Awesome Content Pallav. Why you stop posting new content now a days ? All Good.

  • @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 года назад +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 RUclips 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!!!

  • @nitinbhatia493
    @nitinbhatia493 Год назад

    Create a tutorial on CI/CD please.

  • @pankajkainthla
    @pankajkainthla 2 года назад +1

    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 года назад +1

      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.