-
Content Count
409 -
Joined
-
Last visited
-
Days Won
23
Brandon Staggs last won the day on January 31
Brandon Staggs had the most liked content!
Community Reputation
354 ExcellentTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
That's fair. In my mind, when we start talking about a "new architecture," we go beyond fixing bugs in a system to using a new approach. But it could be that I am misunderstanding what is intended by the statement "new architecture." Though one wonders why this "new architecture" requires waiting for a breaking release. The impression I was left with, after watching that segment of the video three times in a row, was that they know full-well that LSP is still very broken and requires a redesign and they are waiting for a major release rather than fixing the thing in 12.1 or 12.2 or now 12.3. I watched the webinar live and tried to ask a follow-up question about LSP fixes and again felt as though they were saying big changes coming in 13, but that is just an impression and the Q&A is not available in the YouTube post. Too bad we don't have something like a road map to clarify things for us.
-
Edit: as was pointed out by someone else, this non-native speaker may not mean what I mean by "new architecture." But here's what I was referring to: 42 minute mark. Listen carefully where he says there will be a "new architecture" in the next major release.
-
Delphi 12.0, .1, and .2 have been especially hard for us with our million+ line project. 80% of the time Find Declaration doesn't work, and the other 20% of the time it seems random which way works -- CTRL+G or CTRL+Click, sometimes one will work when the other one doesn't. We of course cannot email the "crown jewels" entire proprietary project to Emba for them to test with. I understand they need reproducible examples, but they have also said during the release webinar that they are aware LSP doesn't work acceptably and will be replacing the current system with a completely new approach in 13. Well, this is a fundamental, basic function of any IDE, and personally I question this decision to add new features of any kind while something so basic is known to be non-functional for so many users. But, trying to be fair, I'm sure not all of their developers are qualified to work on LSP so they will naturally be focused on multiple areas at once. I can guess at why LSP has such a hard time with our code base, and I have spent a lot of time trying to remove legacy anti-patterns and cleaning out uses clauses, etc, but in the end, it all compiles just fine, so it should not be a problem for the editor to navigate. An editor should be able to navigate and offer functional code completion with broken code, let alone code that compiles without issue.
-
Obviously I was referring to the 64-bit compiler that was added in 12.2 for the Enterprise level, not the 32-bit compiler that can target 64-bit builds that we have had all these years.
-
It is a priori "OK" because they are a private company which can decide how to spend their R&D money and we are free agents that can decide whether or not to subscribe. I don't know a single Delphi developer who doesn't have a heap of legitimate complaints about the product, but I don't know how this is anything other than a step in the right direction. Is it enough? That's up to each subscriber to decide. I also was pretty harsh on them for packing the 64-bit compiler as a top-tier option prior to this (unavailable to Pro level subscribers), but seen in the light of them trying to work their way to a stable 64-bit IDE, I get it.
-
I don't know that it "doesn't work." But I presume they are doing their best to get to a robust release of the 64-bit IDE as soon as they think they can given their resources. Rolling it out as they are along with a point release seems like an understandable way to get there with more testing and feedback. Shrug. It is "pretty lame" that Delphi is not getting the development and enhancement that it needs, but I don't know that there is any reality-bending that could happen to change that. It's been gone over before. It's a proprietary legacy system and it's clear that their resources are limited.
-
To be fair, they are being very straightforward about it being a "version 1" release and it isn't even enabled by default.
-
I'm curious to hear from people who have experienced failures in 12.2 with code insight and basic navigation features like Find Declaration if this is improved in 12.3.
-
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
I think this debate will never achieve any real consensus, and in the end, each of us needs to just decide what makes sense. Here's a nice fun read from 15 years ago: https://blog.therealoracleatdelphi.com/2010/02/a-case-against-freeandnil_5.html Interesting that Bauer and Primoz take opposite sides. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
Assuming this is what you want me to explain: If you have two places that call FreeAndNil on the same reference, and a logic problem that can lead to both places being called without a clear intent to do so, you will not know about the second FreeAndNil because it will succeed and move on, where a second call to .Free will instead cause a pointer error. Is the second call to FreeAndNil a problem? Maybe not, but the code that runs around it is working on the assumption that the pointer is valid, and you have hidden an error that would expose the problem. David asked what the harm in using FreeAndNil can be. That's what we are discussing. You're allowed to disagree, of course. But the point is to answer the questions about why FreeAndNil should be used for its intended purpose, rather than a debugging tool. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
To be precise, you are using it to catch access to NILLED object pointers. And you believe this is a debugging tool. But really this is just debugging theater. Anyone using FreeAndNil to force AVs when the object reference is next used is de-facto claiming otherwise, and this is where you seem to have gotten lost in my explanation. A *LOT* can happen on a nilled object reference without creating an AV. Understanding why it is designed that way should be enough to answer your own questions about why you should not be abusing FreeAndNil as a debugging tool. There are purpose-built tools for catching use-after-free conditions. FreeAndNil is not one of them. I am just saying it is better to use the purpose-built tools for this instead of relying on a side-affect of FreeAndNil which can only catch use-after-free SOMETIMES. In the projects I work on where FreeAndNil is used everywhere (without need) I just assume that I cannot know for sure if those variables are actually intended to be used again or not. That's fine. In my own code I just make my intent clear by only using FreeAndNil when it is appropriate for the code -- not as a halfway debugging tool. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
This idea has already been debunked in this thread. For example, you can call any function you want on a nil object pointer and those functions could easily affect other things in memory (global variables, for example). It will only AV if that function somehow leads to instance memory being used. For example, you can easily call .Free on a nil object pointer, and it will succeed just fine, and you may actually be hiding a logic error in your code by nilling the object before calling free a second time. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
How can FreeAndNil help with race conditions? There is no locking around what FreeAndNil does, and if it is being used in a threading scenario without proper locking, you are asking for race conditions by using it. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
Code obfuscation: why is it being used? What is the intent? Why did the author of this code deem it necessary to assign free to a variable that appears to be going out of scope? What, as the maintainer, am I not understanding? Other than that, nothing. It's just a small waste of cpu cycles. EDIT: Actually, nilling an object reference with FAN can hide other logic errors such as some code path that could lead to free unintentionally being called a second time. Since free checks for a nil Self, it succeeds, even if it should lead to an AV due to an erroneous double-free. Depending on how that second call to free is reached you could be making it harder for the logic error to surface as an AV. -
Guidance on FreeAndNil for Delphi noob
Brandon Staggs replied to Paul Dardeau's topic in RTL and Delphi Object Pascal
If the variable is going out of scope, it doesn't make sense to nil it. If the variable is not going out of scope, then nil it. I guess the question you might ask is why you would have a reference stay in scope after it is freed. That will depend on what is being done. For example, I do this if I have a lazy-loaded class field exposed as a property that is initialized in is getter. If there is something that invalidates the reference, it needs to be nilled so that it will not be freed again when the class is freed (double-freed), and so that it can be re-initialized the next time the property is read.