• 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: ObjC question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC question


  • Subject: Re: ObjC question
  • From: Tony Romano <email@hidden>
  • Date: Mon, 21 Feb 2011 16:38:12 -0800
  • Thread-topic: ObjC question

Thanks for the reference.

For the record, I wasn't the one suggesting to pass a local address into a container. :-)

Tony Romano

From: Marshall Clow <email@hidden>
Date: Mon, 21 Feb 2011 14:29:15 -0800
To: Tony Romano <email@hidden>, Quincey Morris <email@hidden>
Cc: XCode Apple <email@hidden>
Subject: Re: ObjC question


On Feb 21, 2011, at 1:36 PM, Tony Romano wrote:

Yep, I will join that list.

You example will pass in the address of the local variable and not the one contained in the object(I.e the address is off the stack and not in the memory space of the object).  I wouldn't use the term smelly :-).  What I am trying to do is pass in a reference to a pointer.  The code is from an insert routine for a btree, recursive version to make it a bit clearer of my intentions. 

I think that Quincy was referring to a term from Agile programming called "code smells".
<http://en.wikipedia.org/wiki/Code_smell>

When your code "smells" funny, it means that there's something not right about it, and you should look at it for a possible refactoring and/or as a source of bugs.

In this case, inserting the address of a local variable into a container is a code smell. ;-)
It may not be incorrect, but it's possible/likely that it is.

-- Marshall

Marshall Clow     Idio Software   <mailto:email@hidden>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: ObjC question (From: Marshall Clow <email@hidden>)

  • Prev by Date: Re: Using Bison to Build Multiple Parsers in the Same Application
  • Next by Date: "Hello World" examples for Apple Help?
  • Previous by thread: Re: ObjC question
  • Next by thread: "Hello World" examples for Apple Help?
  • Index(es):
    • Date
    • Thread