-
Content Count
242 -
Joined
-
Last visited
-
Days Won
9
Brandon Staggs last won the day on February 23
Brandon Staggs had the most liked content!
Community Reputation
185 ExcellentTechnical Information
-
Delphi-Version
Delphi 12 Athens
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
TWebBrowser + dynamic JS question
Brandon Staggs replied to David Schwartz's topic in Network, Cloud and Web
Modern web browser design is virtually all asynchronous, so there is no way to do the kinds of things we once did synchronously through direct access to the DOM. I have thousands of lines of code that interacts with the old Internet Explorer COM web browser which I am not looking forward to some day completely rewriting in JavaScript so I can use WebView2.... -
Delphi and "Use only memory safe languages"
Brandon Staggs replied to Die Holländer's topic in General Help
I think this is more like telling a chef he shouldn't dare use a knife because knives are too dangerous and needs to learn how to prepare his food without knives and if he doesn't then he is like people who carry weapons into airports. Or something. -
Delphi and "Use only memory safe languages"
Brandon Staggs replied to Die Holländer's topic in General Help
Wow, you just drew a parallel between using pointer math and carrying weapons on to planes. I'm pretty sure this thread just jumped the shark. I'll refrain from engaging in a conversation about personal sovereignty and weapons here, because it obviously has nothing to do with Delphi having features for doing pointer and bitwise math, LOL. -
Delphi and "Use only memory safe languages"
Brandon Staggs replied to Die Holländer's topic in General Help
You're correct, of course. I just found the "just because you can" charge to be dismissive. He doesn't get that there are good reasons to use these features. Saying they are only used "just because you can" is ignorant, but also arrogantly so. -
Delphi and "Use only memory safe languages"
Brandon Staggs replied to Die Holländer's topic in General Help
So what? Lots of people use Delphi to do it and... why is that a problem for you? You seem irrationally fixated on the fact that some people use this tool for tasks you would not personally use it to accomplish. An no, not "just because you can." "Just because you can" doesn't pay the bills. Anyway I hardly see the point in trying to explain it to someone who seems absolutely determined not to get it. -
CompareString function for UTF8 strings or buffers?
Brandon Staggs replied to MarkShark's topic in RTL and Delphi Object Pascal
If you know the UTF-8 strings have been normalized the same way and you want to test for equality, then do a simple memory comparison. If you need to do anything more complex than that (case-insensitivity, ignoring diacritics, accounting for different normalizations, etc) , then there is no reason not to convert the strings anyway. -
Do you need an ARM64 compiler for Windows?
Brandon Staggs replied to Lars Fosdal's topic in Cross-platform
Microsoft has been "increasing the pressure" on non-WinTel32 development for a decade. I remember thinking Embarcadero needed to hurry up and give me an option to target Windows Phone. Then to get serious about WinRT for Windows 8. Etc. Windows on ARM may indeed eventually matter, but I can hardly fault Embarcadero for taking a "wait and see" approach to the latest-and-greatest non-Win32 "pressure increase" from Microsoft. -
Delphi and "Use only memory safe languages"
Brandon Staggs replied to Die Holländer's topic in General Help
I'll avoid direct pointer math when I can, but when you need to drive video, text, and geometry effects dynamically, live at 60fps, it helps to know theses things and use them where optimization is needed. -
State of an uninitialised variables..
Brandon Staggs replied to Ian Branch's topic in Tips / Blogs / Tutorials / Videos
The assignment operator := certainly signals in my mind that I want to replace the value of the variable with whatever is on the right side. I think someone designing a function should be aware of that and ensure that it is the case, if they are returning managed types. That being said, there may be cases where appending/modifying the Result variable is useful. I'd consider it obfuscated code, or a hack at best. However, I don't agree that Der schöne Günther's code above is unexpected behavior. It is exactly what I would expect reading the code. It may be puzzling at first but it is not a language or compiler flaw. The error was made by whoever wrote the code for the function. Still, I agree a compiler warning would be useful here. -
Delphi should let me use a const array reference as a constant
Brandon Staggs replied to PiedSoftware's topic in RTL and Delphi Object Pascal
https://stackoverflow.com/a/49060/2501336 -
State of an uninitialised variables..
Brandon Staggs replied to Ian Branch's topic in Tips / Blogs / Tutorials / Videos
Agreed that the compiler should let us know if we don't set Result in a function regardless of the result type. -
State of an uninitialised variables..
Brandon Staggs replied to Ian Branch's topic in Tips / Blogs / Tutorials / Videos
The issue here is that Result does not come into scope as your function executes, it already came into scope before your function was called. (Thankfully, it also doesn't go out of scope when your function exits, or your caller would not be able to use the result!) So in this case, you should not have a code path that doesn't explicitly set the Result variable, since you don't know if your caller used the variable after it was initialized or not), but it's not a question of initialization. -
State of an uninitialised variables..
Brandon Staggs replied to Ian Branch's topic in Tips / Blogs / Tutorials / Videos
There is no reason to initialize dynamic arrays or strings. If that is broken in the compiler you have bigger problems. For example, if you are forced to initialize a string to an empty string, then by definition you will end up freeing the invalid string. Better to figure out the actual cause of the problem. -
In case you can't find someone who wants to do this for you, here is a good starting point on learning to do it yourself: http://www.rvelthuis.de/articles/articles-dlls.html http://www.rvelthuis.de/articles/articles-convert.html
-
Do you need an ARM64 compiler for Windows?
Brandon Staggs replied to Lars Fosdal's topic in Cross-platform
It was required to accomplish the original RAD concept for Delphi. It is a dual-edged blade to be sure, but in this case, I will take the bugs that come with having an active IDE that actually runs the components. While you could guarantee that DLLs won't crash if you don't load them into the process (obviously), you aren't going to be able to reproduce all of that with another method, and I am not interested in the compromise.