• 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
forward decls vs #import
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

forward decls vs #import


  • Subject: forward decls vs #import
  • From: Luther Baker <email@hidden>
  • Date: Thu, 14 Mar 2013 18:51:09 -0500

Given today's computing power, is there a strong case that can be made for
or against the general use of forward declarations?

I grew up using them as a best practice in C++ projects ... but more
recently, several seniors Obj-C devs have suggested that they prefer
#import in the .h files.

Initially, I thought this might be related to the prevalence of Java or C#
(which don't deal with such things) ... but the suggestion today was that
forward decls was actually unnecessary typing, not considered a best
practice ... and that, indeed, #importing in the .h file could potentially
actually help weed out bad code.

Am I just from another era?
_______________________________________________

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: forward decls vs #import
      • From: Jens Alfke <email@hidden>
    • Re: forward decls vs #import
      • From: Lee Ann Rucker <email@hidden>
    • Re: forward decls vs #import
      • From: Kyle Sluder <email@hidden>
    • Re: forward decls vs #import
      • From: "Mills, Steve" <email@hidden>
  • Prev by Date: Re: 'Pseudo' Singleton in Objective C
  • Next by Date: Problems with gesture recognizer & child view controller
  • Previous by thread: Re: 'Pseudo' Singleton in Objective C
  • Next by thread: Re: forward decls vs #import
  • Index(es):
    • Date
    • Thread