Jump to content

David Heffernan

Members
  • Content Count

    3536
  • Joined

  • Last visited

  • Days Won

    175

Posts posted by David Heffernan


  1. 18 minutes ago, Tommi Prami said:

    And find file from disk and the spot, sure diff to repo will help, but still, would be life saver when this happens. 

    You are massively overstating this. Finding a file from disk is not difficult. Yes it takes a few seconds, but then it's not like this issue happens regularly. Every feature takes resources to implement. Given the immense problems that the entire Delphi product has, I for one would be disappointed if Emba spent resources on features like this that bring so little benefit.


  2. 6 minutes ago, Tommi Prami said:

    Would be nice IDE would always convert binary to text, if there are one. Got hit by that this summer, there still was few binay dfm's in our repository.

    Not sure the IDE should do that. There are tools to convert. If you want to convert, then use those tools. If the IDE did this automatically then that would be painful for people who wanted to use binary.

    • Like 1

  3. 1 hour ago, Fr0sT.Brutal said:

    Ah yes right I haven't noticed the getter returning pointer to array item. In my record list class I use dynamically allocated records and store pointers only so have no such issues.

    Well, you avoid some of the issues, but not all. For instance you don't avoid the issue where an item is deleted, but a stale pointer is retained. Additionally you end up with a large number of heap allocations, and memory that can be scattered which can impact performance.


  4. 1 hour ago, Uwe Raabe said:

    If I got that right, Stefan is referring to the case where the array is relocated, which invalidates the record pointers. This is not the case for a class list, where only pointers to the class instances are stored inside the array. Relocating such an array will keep the instance pointers intact.

    Granted the indirection that is offered by a reference type does make some of the issues hard to trip over, but they still exist.


  5.  

    6 minutes ago, Lars Fosdal said:

    Can you offer an example?

    TList<T>

     

    FWIW my codebase doesn't use the RTL generic collections. It uses a collections library that I wrote, that amongst other things has collection classes that allow access to items via references to the underlying records for exactly this situation.

     

    I think that you are making valid points, but you aren't pinning the blame in quite the right place. I don't think the issue is with value types per se. To my mind the issues are more about limitations of the standard RTL collection classes.

    • Like 1

  6. 3 hours ago, Rollo62 said:

    I really don't like to have  a  TStringListF for right file handling, a TStringListS for right stream handling, a TStringListKV for right Key/Value handling.

    Files are a special case of streams. And they are orthogonal to collections of strings. A string list is the wrong class for key/value pairs. 

     

    I don't think you need string list interposers for any of these things. 

    • Like 1

  7. 1 hour ago, Rollo62 said:

    @David Heffernan

    More trouble means I have to make all these components work in the designer now, I think there is no neat trick w/o registering them.

    Also they are no more compatible classes, which could be used as "Xyz is TButton".

    You just put them in a designtime package, install it, and then use them. That's what I do. I don't find it at all onerous.

    • Like 1

  8. 7 minutes ago, Rollo62 said:

    But what would be the alternative, to have a separate layer of self-defined components, on top of the existing ones.

    Yes.

     

    7 minutes ago, Rollo62 said:

    That would basically do the same job as the interposers, but would cause a LOT more trouble in designing the forms.

    No, it's no trouble at all.

    • Like 1

  9. 32 minutes ago, Lars Fosdal said:

    Which is why I don't use dictionaries with records. It is rare that I load up a dictionary and do not need to change some of the content later.
    If I was insistent on doing records, I would probably write code that ordered the array by the key and did binary lookup to a pointer to the record.

    How is it any different from holding them in TList<T>?

    • Like 1
×