If you want ARC on desktop, please vote:

If you want ARC on desktop, please vote:
https://quality.embarcadero.com/browse/RSP-16179

https://quality.embarcadero.com/browse/RSP-16179

Comments

  1. Eric Grange In general you don't use weak references but unowned in parented tree structures. And I never said you don't ever use weak references, I said you don't have to litter your code with them. There is a difference.

    And there is nothing fragile about weak references, of course, before using them you have to check for nil, but that is not any different than using Assigned or checking for nil in existing Delphi code. I don't see any problems here.

    ReplyDelete
  2. Eric Grange As far as going stone age with weak, you can create nice memory leaks under GC, too. http://android-developers.blogspot.hr/2009/01/avoiding-memory-leaks.html So there is no silver bullet no matter what you choose (or have).

    But what I meant by going stone age with GC is avoiding object creating. In practice that usually means moving temporary local objects from local methods to class private field. Especially if you use GC language where everything is an object (like Java).

    That also includes working with brilliant graphic APIs where you don't pass list of points (objects around) but list of integers or floats where every other is y coordinate. Code readability equals zero.

    And of course, avoiding complex DI frameworks because they put too much strain on GC (and even simple ones do that)

    ReplyDelete

Post a Comment