Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Do you use garbage collection?

  • Yes I do (either in "supported" or "required" mode)

    Votes: 4 28.6%
  • No I don't, I do manual retains/releases/autoreleases

    Votes: 10 71.4%

  • Total voters
    14

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
I'm just curious, and decided to run a poll on how many developers turn on garbage collection in Xcode, and how many leave it off.

Vote please, and also feel free to discuss the pros/cons, and if it makes life much easier for you or not, and any noticeable impact you've seen on your apps.
 

laprej

macrumors regular
Oct 14, 2005
108
2
Troy, NY
I do use GC and feel it allowed me to prototype something (non-professional) quickly. I had to write a discrete event simulator in Objective-C, pass network packets back and forth between wireless nodes, use NSInvocations for delayed messages, etc. If I had to maintain proper retain counts along the way, I feel my time to develop this software would have doubled or more. My time is better spent ensuring proper protocol behavior than chasing down places where I should/should not have retained.
 

foidulus

macrumors 6502a
Jan 15, 2007
904
1
You still pretty much have to unless you are developing Leopard only apps. GC isn't supported on Tiger or iPhone, so nice to get into the retain release habit.
 

ManWithhat

macrumors regular
Jun 24, 2008
220
0
It's more efficient to manually garbage collect, which is one of the reasons C++ is faster than C#/Java (Java has its own issues). Anyways, it's a good habit to get into and generally not that difficult to do if you're following a proper Object-Oriented programming style.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
I wish I could turn it on, but I can't. Converting a >250,000 line application built pre-GC and with tons of crosstalk with various cross platform C libraries to use GC? Not fun. Maybe not even possible to do without breaking tons of stuff.
 

Mac Player

macrumors regular
Jan 19, 2006
225
0
NEVAH!!!!! It's so easy to manage memory in Objective-C why should i waste cycles with a GC that has so many twists?
 

LtRammstein

macrumors 6502a
Jun 20, 2006
570
0
Denver, CO
I believe it depends on what the code's purpose is for.

I personally believe manually handling it is better. It allows you to think outside the box when it comes to problems that you run into during compile/writing.

Garbage Collection is nice, but I feel if we leave basic memory management knowledge to be automated, we'll be under mountains of pointers pointing to nothing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.