• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Looking at self = [super init].
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking at self = [super init].


  • Subject: Re: Looking at self = [super init].
  • From: Graham Cox <email@hidden>
  • Date: Wed, 03 Jun 2015 10:08:52 +1000

> On 3 Jun 2015, at 9:03 am, Michael David Crawford <email@hidden> wrote:
>
> "That's because comments are rarely maintained in sync with the actual
> source code."
>


So part of the responsibility of coding well is to maintain comments, not to remove them altogether.

At a minimum, I comment what a method does, in broad terms, and what the parameters are for, if they’re not obvious. Also, any ”tricks” should be commented. Any code that only works because of some hidden factor that isn’t obvious should be commented. Any non-obvious algorithm should be commented, and so on. Code that is “obvious” is generally not worth commenting - it only adds clutter. The example you gave was “obvious” in my opinion, so there wouldn’t normally be a comment there, even if it was correct.

 All this is usually covered in the style guide for coding that your employer probably has, if they do any sort of serious coding. If you work for yourself, you should have one as well.

I don’t trust completely uncommented code.

—Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Looking at self = [super init].
      • From: Michael David Crawford <email@hidden>
References: 
 >Re: Looking at self = [super init]. (From: Dave <email@hidden>)
 >Re: Looking at self = [super init]. (From: Britt Durbrow <email@hidden>)
 >Re: Looking at self = [super init]. (From: Quincey Morris <email@hidden>)
 >Re: Looking at self = [super init]. (From: Charles Srstka <email@hidden>)
 >Re: Looking at self = [super init]. (From: Michael David Crawford <email@hidden>)
 >Re: Looking at self = [super init]. (From: Britt Durbrow <email@hidden>)
 >Re: Looking at self = [super init]. (From: Charles Srstka <email@hidden>)
 >Re: Looking at self = [super init]. (From: Jens Alfke <email@hidden>)
 >Re: Looking at self = [super init]. (From: Charles Srstka <email@hidden>)
 >Re: Looking at self = [super init]. (From: Jens Alfke <email@hidden>)
 >Re: Looking at self = [super init]. (From: Charles Srstka <email@hidden>)
 >Re: Looking at self = [super init]. (From: Kyle Sluder <email@hidden>)
 >Re: Looking at self = [super init]. (From: Michael David Crawford <email@hidden>)

  • Prev by Date: Re: Looking at self = [super init].
  • Next by Date: Another bindings question
  • Previous by thread: Re: Looking at self = [super init].
  • Next by thread: Re: Looking at self = [super init].
  • Index(es):
    • Date
    • Thread