What is Object Oriented Programming for Swift | Swift Basics #8

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024

ความคิดเห็น • 49

  • @jcclcreations7909
    @jcclcreations7909 8 หลายเดือนก่อน +12

    I'm the type of learner that I need to know why I'm doing something in order for me to retain the information and put it into use for myself, otherwise I'm just copying and pasting from memory. I have been trying to find a good description that separates a class and a struct and you're the first person in a very long time to explain it so clearly and to the point. So many tutorial videos on TH-cam start with just creating an app. While I get that repetition for programming is needed, you also need to know why you're doing something because otherwise you won't understand how to implement unless told to. This entire video series has been amazing. Thanks for all the great work you put into these.

  • @anastasiash2516
    @anastasiash2516 ปีที่แล้ว +12

    This playlist would save me so much time if it existed when I started learning Swift! Great content, Nick. Thank you for the beginner-friendly explanations.

  • @mateuszszafarczyk2523
    @mateuszszafarczyk2523 ปีที่แล้ว +6

    Hi Nick! First I am to thank you for your videos. I have learned a lot from them!
    I wanted to point out that ARC in this video could be wrong explained.
    Automatic Reference Counting (ARC) does NOT:
    -Count the total number of objects in memory.
    Automatic Reference Counting (ARC) DOES:
    -Keep a count of the number of references to a particular object in memory.
    -Increment the count when a new reference to the object is established and decrement it when a reference is removed.
    -Deallocate the memory occupied by an object when the reference count drops to zero, meaning there are no more references to the object and it's no longer accessible in your program.
    So, ARC in Swift is about managing the number of references to specific instances, not a count of all instances in memory. This helps to avoid memory leaks and efficiently manage memory in applications.
    @SwiftfulThinking please give a comment on that. I got it wrong from the video or it is indeed wrong explained?

    • @OldAlfArgentum
      @OldAlfArgentum 2 หลายเดือนก่อน

      you are right reference count is to individual instances of any class, so, is counting of references to one object from the stack of execution

    • @AshwaniKumar-ew1cn
      @AshwaniKumar-ew1cn 2 หลายเดือนก่อน +1

      Point to be noted!

  • @qiyanpepenanook598
    @qiyanpepenanook598 ปีที่แล้ว +6

    I wish I could have learned that way at the beginning of my career. Amazing tutorials. Thank you

  • @alexzlatic8482
    @alexzlatic8482 ปีที่แล้ว +4

    This playlist is awesome, and addresses so many of the base level questions and confusions that have discouraged me from learning Swift and SwiftUI in the past. Thank you!!

  • @sele_br129
    @sele_br129 4 หลายเดือนก่อน +1

    What a class! This is amazing omg! Thank you so much for recording this video!

  • @rallygsixtwo4836
    @rallygsixtwo4836 9 หลายเดือนก่อน

    Haven't done any sort of programming since very basic Unity C stuff in high school. These tutorials are amazing!

  • @gabrielkime6597
    @gabrielkime6597 9 หลายเดือนก่อน +1

    This is an awesome video, I love how much context you give for WHY different practices and syntaxes exist in swift. You do a great job of breaking down a complex subject, and as someone who struggles with just doing something without knowing why, its really helpful how you take the time to compare and contrast concepts and also to relate them to more fundamental CS concepts at the same time. Big thumbs up, you have a new subscriber!

  • @ubu-ibme
    @ubu-ibme 8 หลายเดือนก่อน

    Hey Nick. First off, thanks!!!! This playlist is extremely helpful. Secondly, just wanted to give you my take on this video specifically. I've been writing "professionally" (for my job) in C# for the last 5 years plus, i.e., I've hit my 10,000 hours with C# more or less. I went to school for engineering, not computer science, so the majority of what I've learned has been self taught as well. This video has been my favorite so far. Granted, all the videos leading up to this video have been essential as well since C# doesn't transfer the easiest to Swift's declarative style, not to mention learning basically all new syntax. But this video... for me, this video is GOATed. It filled in a bunch of gaps and provided A TON of great refreshers!! Thanks, man!!

  • @jalapisco
    @jalapisco 6 หลายเดือนก่อน

    Excellent way to break it down. I watched the advanced video you are referring to on this video few months ago; you also did an awesome job on that one too.

  • @MannyWalks
    @MannyWalks 6 หลายเดือนก่อน +2

    mamma mia Nick, you're something else on how you explain things 🔥🔥🔥
    Thanks so much 🙏

  • @amaniduniaapps
    @amaniduniaapps 7 หลายเดือนก่อน

    Hey Nick, I'm very amazed about how clear you explained this. Well Done! 🤓

  • @drkadambarijaderam4766
    @drkadambarijaderam4766 4 หลายเดือนก่อน

    Theory is so important and often overlooked. Well done!

  • @ArthurSh
    @ArthurSh 10 หลายเดือนก่อน

    i mean, that metaphor saved me so much time, also section where to use classses and struct made it much clearer how typically it's being used in real projects, thank u for this wise and simple work, liked & subscribed, wish you a lot of health and good days in your life.

  • @manishparihar3361
    @manishparihar3361 ปีที่แล้ว

    Well explained Stack and Heap also Class and Struct. I love the way you explained swift

  • @alexliebhaber3109
    @alexliebhaber3109 3 หลายเดือนก่อน

    Glad I found this channel. Thank you for what you do!

  • @samanthawithanage7521
    @samanthawithanage7521 ปีที่แล้ว +1

    Awesome, this is really helpful in understanding the concepts. Thanks a lot 🎉🎊

  • @loudibird
    @loudibird ปีที่แล้ว +1

    you're way to hard on yoursel, this is all making sense to me. Thanks alot man

  • @zlatkoiliev8927
    @zlatkoiliev8927 ปีที่แล้ว +2

    Thank you for doing this video series. I am learning a lot! Are you also planning to update the SwiftUI course after this one? There are many new things there too!

    • @SwiftfulThinking
      @SwiftfulThinking  ปีที่แล้ว +5

      Yes, I append videos to the end of every playlist as new features come out. 99% of the SwiftUI Bootcamp is still relevant and anything deprecated should be addressed in the appended videos. iOS 17 updates will be added soon 🤙

  • @HUNTELAAR11W
    @HUNTELAAR11W ปีที่แล้ว +1

    Where do you learn all these things?
    Thank you as always Nick!
    You are awesome! 🤙

  • @jean-michelnogaro7471
    @jean-michelnogaro7471 ปีที่แล้ว

    Enfin .. la lumière pour moi struct vs class 💡

  • @jlambert12013
    @jlambert12013 ปีที่แล้ว

    Thank you. This is exactly what I needed.

  • @acordafitnesstv
    @acordafitnesstv 9 หลายเดือนก่อน

    Great tutorial!! Thanks for sharing !😊

  • @김현진-t8r6f
    @김현진-t8r6f ปีที่แล้ว

    This video is awesome. You helped me understand some of the unclear things between structs and classes and more.
    I have one question. Why is it called object 'oriented' programming? is it because we can create and destory objects with Swift? or is there more than that?
    Thank you for making this video😊

  • @m.d.2029
    @m.d.2029 4 หลายเดือนก่อน

    Огромное спасибо, дружище! Это круто!

  • @y.v.8803
    @y.v.8803 7 หลายเดือนก่อน

    Amazing, keep up the great work

  • @psps4754
    @psps4754 ปีที่แล้ว

    Awesome explanation

  • @toddlask
    @toddlask ปีที่แล้ว +1

    youre a true badass! hey could u do a vid on @observable , @state , @environment and @binding stuff? i saw a wwdc vid on it... blew my mind up!

  • @saturos5403
    @saturos5403 8 หลายเดือนก่อน

    Incredibly confused but it helped me out

  • @warrenscorner
    @warrenscorner ปีที่แล้ว

    Wow! My ADD kicked in about half way through that. 😂 All I heard after that was blah, blah, blah. I’m gonna have to watch that again and maybe again.

  • @leon.dev89
    @leon.dev89 11 หลายเดือนก่อน

    Very good video.

  • @elaidzhashchukin7268
    @elaidzhashchukin7268 ปีที่แล้ว

    u r the best man 💪

  • @MosabbirSadman
    @MosabbirSadman ปีที่แล้ว

    Thank you as always Nick!
    You are awesome! 🤙
    I have a question, though: If we need to handle shared references, would using a class as a data model be the right choice? Otherwise, with a struct, we'd have to manually update all copies of the struct that we reference, correct?
    Additionally, I wanted to inquire if you've got any plans to release any paid courses on the website in the future?

    • @flash698
      @flash698 ปีที่แล้ว

      If you need to keep track of multiple copies of the same data, you should use a class instead of a struct. With a struct, you would have to manually update each copy of the struct whenever you make a change. This can be a pain and easy to mess up. Also not to mention error-prone.
      Classes, on the other hand, being reference types means that when you create a class instance, since swift keeps track of all the copies of that instance. If you make a change to one copy of a class instance, all the other copies will also be updated. This makes it easy to keep track of shared data.

    • @MosabbirSadman
      @MosabbirSadman ปีที่แล้ว

      @@flash698 Thank you for the reply. But if you use a class for this scenario, doesn't this come with some performance cost?

  • @rvst3682
    @rvst3682 ปีที่แล้ว

    hey nick, can you please make a video that are more "advance" from OOP?😁

    • @SwiftfulThinking
      @SwiftfulThinking  ปีที่แล้ว

      It’s right here: th-cam.com/video/-JLenSTKEcA/w-d-xo.html

  • @kavinda_dilshan_paramsoodi
    @kavinda_dilshan_paramsoodi ปีที่แล้ว +2

    Seems like NIck has a 5-year old neighbour next door.

  • @simply6162
    @simply6162 ปีที่แล้ว

    is Stack basically L1,L2,L3 cache and HEAP is basicaly RAM which is slower?

    • @SwiftfulThinking
      @SwiftfulThinking  ปีที่แล้ว +1

      I’m not sure to be honest… they both might be RAM but I could be wrong. Let me know if you find the answer!

    • @simply6162
      @simply6162 ปีที่แล้ว +1

      @@SwiftfulThinking yes they are all on ram, thats what i found: Yes, both the stack and the heap are stored in a computer's RAM (Random Access Memory).
      The stack is a region of memory used for local variables, function call frames, and other temporary data. It grows and shrinks automatically as functions are called and return. Each thread in a program has its own stack.
      The heap, on the other hand, is a region of memory used for dynamic memory allocation. It is where objects and data structures created with `malloc`, `calloc`, `new`, or other allocation methods are stored. Unlike the stack, the heap does not have a specific size limit and can grow as needed.
      Both the stack and the heap are important components of a program's memory management. The stack is typically used for managing function calls and local variables with automatic storage duration, while the heap is used for managing dynamically allocated memory that persists beyond the scope of a single function call.

    • @SwiftfulThinking
      @SwiftfulThinking  ปีที่แล้ว +1

      @@simply6162 thanks for posting! I’m sure someone else will find this helpful too 👌

  • @Foxekins
    @Foxekins ปีที่แล้ว

    The way I see it is that classes are more like an object that is a let vs a struct where the object can be edited like a var, I may be wrong I'm new, but I'm okay with being wrong.

  • @DannyBoy443
    @DannyBoy443 6 หลายเดือนก่อน

    The value vs reference editing makes 0 sense lol. How it does work: Editing a value edits a copy. How it SHOULD work: Editing the value is editing the actual value, done and done. Why create a new copy? Same but flipped for the reference type. This is one of the issues about learning this for a career that is making me re consider. It's dumb.

  • @marsrocket
    @marsrocket 4 หลายเดือนก่อน

    Dude….good video but you spent the first 7 minutes saying the same thing over and over