• 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: Swift Interface vs Implementation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift Interface vs Implementation


  • Subject: Re: Swift Interface vs Implementation
  • From: Richard Charles <email@hidden>
  • Date: Sat, 22 Nov 2014 00:27:38 -0700

On Nov 21, 2014, at 10:09 PM, Daniel Blakemore <email@hidden> wrote:

> I've personally never whined about any of this.  I really like have a place to put all my documentation that is cleanly separated from where the actual work gets done.  In larger files, the large headerdoc comments would destroy any sense of position in the implementation file with unnecessary bloat.

On Nov 21, 2014, at 7:24 PM, Quincey Morris <email@hidden> wrote:

> The trouble is that header files basically cause you to replicate source code (and source keystrokes).

Here is an example of one of my Objective-C classes.

Header File
     2 Enumerations
     6 Properties
     16 Methods
     118 Lines

Source File
     2 Properties
     75 Methods
     2039 Lines

Perhaps it is just me, but it is not uncommon for my source file to have many more methods than what is in my header. So for me it is not the replicated code in the header file that is a negative but rather it is being forced to define the interface that ends up being a positive.

My documentation style is patterned after Richard Hipp’s SQLite project where a detailed description of each interface routine is found in the source code. A quick glance at the header file gives you an overview of the interface. If you need more information then go to the source code.

Overall this results in smaller header files and a more readily comprehended interface. I find this very beneficial when working with a large project, it help me keep my sanity.

Richard Charles


_______________________________________________

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: Swift Interface vs Implementation
      • From: Fritz Anderson <email@hidden>
References: 
 >Swift Interface vs Implementation (From: Richard Charles <email@hidden>)
 >Re: Swift Interface vs Implementation (From: Quincey Morris <email@hidden>)
 >Re: Swift Interface vs Implementation (From: Daniel Blakemore <email@hidden>)

  • Prev by Date: Re: CFRunLoopRef to NSRunLoop: how?
  • Next by Date: Re: Binding a unique-selection checkbox in a table view?
  • Previous by thread: Re: Swift Interface vs Implementation
  • Next by thread: Re: Swift Interface vs Implementation
  • Index(es):
    • Date
    • Thread