-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
New feature request: Open dfm as Text if malformed (vote if care)
David Heffernan replied to Tommi Prami's topic in Delphi IDE and APIs
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. -
New feature request: Open dfm as Text if malformed (vote if care)
David Heffernan replied to Tommi Prami's topic in Delphi IDE and APIs
Doesn't seem to me like this is a very significant problem given that you can just open the file in a text editor yourself. -
New feature request: Open dfm as Text if malformed (vote if care)
David Heffernan replied to Tommi Prami's topic in Delphi IDE and APIs
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. -
New feature request: Open dfm as Text if malformed (vote if care)
David Heffernan replied to Tommi Prami's topic in Delphi IDE and APIs
If it is in binary form then presumably there would be no need because there would be no problem in it -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
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. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Granted the indirection that is offered by a reference type does make some of the issues hard to trip over, but they still exist. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
In a collection which owns its members then removing an item leads to a stale reference in either scenario (classes vs records). -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Your third sentence directly contradicts the first sentence. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Yes, this should be a read only property. In an ideal world we'd have proper language support for references, as I think is especially we done in D foreach (ref elem; arr) { elem = 0; } -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
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. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Not if you use a collection that provides you access to items via references to the underlying records -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
That is correct. But that's not the point you made. -
On the use of Interposers
David Heffernan replied to FPiette's topic in RTL and Delphi Object Pascal
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. -
On the use of Interposers
David Heffernan replied to FPiette's topic in RTL and Delphi Object Pascal
That's true of course, but the problem arises the moment you use a single third party component. -
On the use of Interposers
David Heffernan replied to FPiette's topic in RTL and Delphi Object Pascal
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. -
On the use of Interposers
David Heffernan replied to FPiette's topic in RTL and Delphi Object Pascal
Yes. No, it's no trouble at all. -
How to handle generic hyperlinks in TRichEdit
David Heffernan replied to David Schwartz's topic in VCL
This is the SO post: https://stackoverflow.com/questions/63823156/using-delphis-trichedit-is-there-a-way-to-set-up-a-link-so-someone-can-click I can comment Remy's answer in the dupe, which I am using to good effect: https://stackoverflow.com/a/42536393/505088 -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
We don't need a topic or any examples. We all know that records can be used as generic types. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
You can use records and classes with generics. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Really? How are the records allocated? And if you could do that, why couldn't you do exactly the same with a dictionary. Which is my original point. If you can't use a dictionary with records, then I don't see that you can use any collection with records. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
How is it any different from holding them in TList<T>? -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
It depends on how you want to access the data. This isn't really related to associate array style access by key. The issues with value types and copying apply equally to all containers. -
Generics: Classes vs Records - Differences in use
David Heffernan replied to Lars Fosdal's topic in Algorithms, Data Structures and Class Design
Why not? Surely the answer is the same as for objects. If you use a dictionary for objects, why not a dictionary for records? -
Dynamic arrays and copying
David Heffernan replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
This issue is covered explicitly by the documentation: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Structured_Types_(Delphi)#Dynamic_Arrays -
Open array parameters and subranges
David Heffernan replied to Stefan Glienke's topic in Tips / Blogs / Tutorials / Videos
But your code can only be used for arrays of byte. Stefan is demonstrating generic code.