You Need to Document Your Swift Code with DocC

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

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

  • @seanallen
    @seanallen  5 หลายเดือนก่อน +2

    Learn more Swift and SwiftUI with my courses at seanallen.teachable.com

    • @Sachka
      @Sachka 5 หลายเดือนก่อน

      hey, i'm an ai engineer, i'm looking forward to purchase a vision course where you would showcase how to talk to a 3d asset, i mean just create the 3d sphere of siri a version that follows you around would be enough, btw keep the good work

  • @austnsauce2543
    @austnsauce2543 5 หลายเดือนก่อน +10

    Wow I just wrote down "learn ios documentation" on my todo list for my app and this video shows up today. Thanks!

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      👀

  • @kennvillegas2014
    @kennvillegas2014 5 หลายเดือนก่อน +2

    This is really interesting. Having a strong background in ObjC\Cocoa I am very used to this Markdown style
    The ONE thing that I will add is that you can ALSO do this with a foldable block-comments just starting with standard /** */ delimiters

  • @dre5671
    @dre5671 5 หลายเดือนก่อน +4

    Pro Tip: Ask Claude or GPT to add documentation for your code. It’s usually pretty great right away.
    Extra pro tip, build your own gpt to use things like important/tip/warning/etc, also back ticks to improve your documentation
    Didn’t know about the back ticks and the important bubbles till now! Sweet stuff 🙏🏼

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      I'm a big fan of those important bubbles.

  • @s81n
    @s81n 5 หลายเดือนก่อน +8

    I get some heat sometimes at work for saying "There's no such thing as self-documenting code" but I stand by it. Your code may say what you're doing, but it can't tell why you're doing it and the why is the important part the comments need to cover. That being said I also don't accept uncommented pull requests. Too many people need to touch our code years from now, those comments are important.

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +3

      I agree. The "why" is SO important.

  • @danuff
    @danuff 5 หลายเดือนก่อน +5

    OMG THANK YOU. Never knew what DocC actually did until now. I'll be busy for the next few hours. 🙂

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      Happy to help!

  • @darylewalker6862
    @darylewalker6862 5 หลายเดือนก่อน +2

    Thanks for telling me about the side-panel documentation preview!

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      It's pretty cool

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

    I’m new to coding, 👨🏼‍💻 and I’m so glad I found this because I comment the daylights out of my code. I think most of my pages are more comment than code.
    I just wish there was a tool like this to write User Manuals for the finished app, not just the developer documentation 😭

  • @DaveJacobseniOS
    @DaveJacobseniOS 5 หลายเดือนก่อน

    Fantastic walkthrough! I just joined a new company that uses DocC and I've never dealt with it before so this is very timely 👌

  • @fg8520
    @fg8520 5 หลายเดือนก่อน +1

    please tutorial on airdrop usage in your app, great video as always

  • @RyanPhung725
    @RyanPhung725 5 หลายเดือนก่อน +1

    Thanks for the video! If you have a lot to document for a function, the inline documentation would get very large. Is there a way to bring this to a new file or hide it some way? Thank you!

  • @nigelgee3576
    @nigelgee3576 5 วันที่ผ่านมา

    Is there somewhere that documents the Documents! I knew about - Important: but not about the others or add code examples. There are other like - Authors: etc

  • @kris_torres
    @kris_torres 5 หลายเดือนก่อน +2

    Nice vid on DocC. I didn’t know that you can do double ticks for the code links. 🙂
    Quick question: Do you recommend also commenting the private structs, methods, et al., or only the ones that are “public”?

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      Based on this question, I assume you're building a library. In that case, these are for two different "users". The public functions or for other developers that use your library, so I'd say that's a must. All the private functions are for you and your internal team. So if you want good documentation for you and your internal team, then I would say yes. If that's not important to you, then don't.

  • @bryceellis112
    @bryceellis112 5 หลายเดือนก่อน

    This is was a very impactful video. Thanks for sharing.
    When you include code snippets (6:18) could you put them at the end of your file? Or does it make most sense to keep it near the function

  • @marceljaeger
    @marceljaeger 5 หลายเดือนก่อน +1

    Nice video, DocC is amazing! While you are in the developing process of an app, you might know every function. But after a few weeks break, it`s so hard and annoying to dive in the codebase again, if the project is big and you haven't write a documentation. 😵

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      Exactly :)

  • @Stricken174
    @Stricken174 5 หลายเดือนก่อน

    Documentation is a great feature, i'm using from time to time to indicate some spicy stuff with warnings.

  • @TE_-.-
    @TE_-.- 5 หลายเดือนก่อน +2

    Just a quick question, can you collapse these comments in the code base or hide them in some other way? Yes, it's good to see them, but for me it's too confusing when I see so many lines of comments.

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      I'm not sure, but I agree with your sentiment. That's why I changed the color of my comments/documentations in Xcode to be a light grey so it's not prominent. My code is colorful so that's what sticks out while the comments kind of blend into the background. That's my solution for this at least.

    • @roygalaasen
      @roygalaasen 5 หลายเดือนก่อน

      I posted a link to a helpful article, but it seems to have been removed. I will not repost the link, but wanted to add a comment from other posters here that you can make foldable comments with the block comment tag /** */

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      @@roygalaasen Hey Roy, I didn't remove the comment (I never do that). Not sure what happend.

    • @roygalaasen
      @roygalaasen 5 หลายเดือนก่อน

      @@seanallen Maybe it was filtered out automatically by Google or something as all I posted was a link to an article on Medium with no more context other than it was clear by the url where the link would go plus the topic.
      I was going to add to that link but it was gone. These things happens, by saying the comment was removed, I didn’t mean necessarily that _you_ were the one removing it.
      It actually happens once in a blue moon, could just be a TH-cam bug as well.

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

    Helpful information 🙌

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

      Glad it was helpful!

  • @muncho404
    @muncho404 5 หลายเดือนก่อน +1

    Thanks for sharing Sean

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      You bet!

  • @ianfrye8988
    @ianfrye8988 5 หลายเดือนก่อน +1

    Great video my friend!

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      Glad you enjoyed it!

  • @vamsi3877
    @vamsi3877 5 หลายเดือนก่อน +1

    Awesome Sean 👏

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      Glad you enjoyed it

  • @KuisebGecko
    @KuisebGecko 5 หลายเดือนก่อน

    Sean, you once apologised in a video for being 'anal', I for one appreciate your desire to make the code more readable. My code has grown to the extent where I would be spending more time on figuring out what my previous code did rather than spending that time to improve the app. I have taken a stab at DocC once but found myself wasting more time in trying to figure it all out; so thank you VERY MUCH for your videos on summarising these important tools. Like a previous poster said, your videos very often come out at EXACTLY the right time.😎👍

  • @BehindTheFilm
    @BehindTheFilm 5 หลายเดือนก่อน +1

    So good 🤩 Thanks for sharing!

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      I’m a big fan of this. Happy to share!

  • @arrwoodo
    @arrwoodo 5 หลายเดือนก่อน +1

    That was REALLY helpful! ThX!)

    • @seanallen
      @seanallen  5 หลายเดือนก่อน

      Glad it helped!

  • @samtr4439
    @samtr4439 5 หลายเดือนก่อน +1

    Thanks Sean.

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      Any time

  • @JasonMitchellAZ
    @JasonMitchellAZ 5 หลายเดือนก่อน +1

    I've been using doc comments some, but learned some more cool things I didn't know about.
    Also, you can use multi-line style commenting for doc comments, too - i.e. /** and close with */

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      Thanks for sharing that! So many cool tricks with this.

  • @bored7743
    @bored7743 5 หลายเดือนก่อน +1

    Kudos for learning this shit. Couldn’t do it. Bored me to death

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

    Why comment your code it makes the file sizes way bigger (using up token count for A.I), its easier to feed an A.I all your code and ask it questions.

  • @nileshjdarji
    @nileshjdarji 5 หลายเดือนก่อน +1

    Wow! This is wild. 👍

    • @seanallen
      @seanallen  5 หลายเดือนก่อน +1

      Pretty cool, right?

  • @Spacer-l3j
    @Spacer-l3j 5 หลายเดือนก่อน

    nice one chief

  • @victorriurean
    @victorriurean 5 หลายเดือนก่อน +1