Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 04/14/24 in all areas

  1. David Schwartz

    Delphi and "Use only memory safe languages"

    Pretty much any programming language that lets you do bitwhacking can do this. Just like anybody can walk on their hands or ride a unicycle with some practice. The question is, "Why?" Just because you can? Most people would argue that C is far better for this sort of thing. Sure, Delphi already does this, but I don't see it being used as a language of choice by devs who do a lot of bitwhacking, like gamers. But at some point, this becomes a circular argument: Why doesn't Dephi support language features that most contemporary languages now include? Because nobody uses Delphi for that purpose. Why is that? Because it's too inefficient without the built-in language support. As if that's going to encourage the Powers That Be to take an "Add it and they will come" attitude... I want to see enhancements that make the language safer, and make it easier to use with less verbiage for things that other languages now routinely support. Constantly offering-up verbose and unsafe workarounds is not encouraging to anybody.
  2. https://blogs.embarcadero.com/6-books-about-delphi-you-should-read/ https://en.delphipraxis.net/topic/10623-good-delphi-learning-sites-for-new-team-member/?tab=comments#comment-84363
  3. FreeDelphiPascal

    Delphi and "Use only memory safe languages"

    obj := TObject.Create; FreeAndNil(obj); FreeAndNil(obj); ------------------------------ On SO somebody wrote an example like this to prove how unsafe Delphi is: s: String; i: Integer; begin s:= 'four'; for i:= 1 to 1138 do begin write( s[i] ); // What will it access after i=4? end; end; At one point, we should stop talking about how safe the programming language is and start talking about how "unsafe" is the programmer 🙂 🙂
  4. PeterBelow

    Delphi and "Use only memory safe languages"

    Consequent use of interface references (with rerf counting for lifetime control) instead of object references avoids that problem completely.
  5. Stefan Glienke

    Delphi and "Use only memory safe languages"

    This is why many modern and widely used languages have settled on using garbage collection (an automatic memory reclamation system) - because then the runtime deals with that and not the developer.
  6. Cristian Peța

    Delphi and "Use only memory safe languages"

    The sources must register to the collector. And unregister when the source does not need the collector anymore. The collector must not be destroyed if there is an active source. This is a little like ARC for interfaces work.
  7. Lars Fosdal

    Delphi and "Use only memory safe languages"

    Ref := ItemProvider.Grab(ItemId); // or Ref := ItemProvider.GrabForChange(ItemId); try // do stuff finally ItemProvider.Drop(Ref); end; ItemProvider can do the allocation and loading, as well as the disposal. If there is parallell use, it can secure against readers/other writers, have a keep-alive in cache period, etc. In theory, with the "smart pointer" trick, you could even do away with the try/finally.
  8. Dalija Prasnikar

    Delphi and "Use only memory safe languages"

    If you really need to have multiple references to an object, then use interfaces and ARC to manage lifetime. If not, then you will have to invent similar mechanism for managing the lifetime.
  9. Nigel Thomas

    Looking for a couple of good "starter" Delphi books

    Don't get hooked up on just books. There is a lot of useful visual material on the Net that is targeted at Delphi beginners. Embarcadero's Helpful Resources for New Users has some good links to both books and visual resources.
  10. I'm using Alexandria (RAD Studio 11.1) but when I try to configure my Android 64 bit project in the Options > Building > Delphi Compiler > Compiling options. After select "All configurations - Android 64-bit platform" as the active target, I don't found in the "Other options" the "Generate Android App Bundle file (arm + arm64)". In the online manual at this link: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Submitting_Your_Android_App_to_Google_Play there is also an image showing this option, but in my delphi it is not present! This option instead is present in 10.4.1. Without this option it is not possible to have an .aab file to upload to the Google Play Console. Can someone help me?
  11. Its available under All Android 64 Bit, and should be under Release Android 64 Bit as well Did you switch in both Android 32 and 64 to the Application Store ? Did you provide in the Project options provisioning the requred data and verified it ?
  12. Brandon Staggs

    Delphi and "Use only memory safe languages"

    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.
×