Jump to content

Dalija Prasnikar

Members
  • Content Count

    1150
  • Joined

  • Last visited

  • Days Won

    106

Dalija Prasnikar last won the day on July 16

Dalija Prasnikar had the most liked content!

Community Reputation

1536 Excellent

Technical Information

  • Delphi-Version
    Delphi 12 Athens

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Dalija Prasnikar

    New Delphi features in Delphi 13

    Beauty is in the eye of the beholder. I literally get dizzy trying to read your code formatting. Even with braces I very much dislike any style besides Allman, and in Pascal, begin and end absolutely must be on the same vertical line for me.
  2. Dalija Prasnikar

    New Delphi features in Delphi 13

    I hear you...
  3. Dalija Prasnikar

    New Delphi features in Delphi 13

    And then you write things like this https://quality.embarcadero.com/browse/RSP-23924 function TBaseFoo.BrokenFoo: IFoo; var LOwner: TComponent; begin Result := nil; if Supports(Self, IFoo) then Result := Self as IFoo else LOwner := Owner; // if block execution will continue here !!!! while LOwner <> nil do begin if Supports(LOwner, IFoo) then begin Result := LOwner as IFoo; Break; end else LOwner := LOwner.Owner; end; end;
  4. Dalija Prasnikar

    A smart case statement in Delphi?

    Oxygene has plenty of features that would be great to have in Delphi. I wanted to have a case statement with strings for years now. I think it was even reported in the old, old Quality Central. If may look like a simple thing but it makes code more readable. Now when we got if expressions, maybe we wil eventually get case with strings, too.
  5. Dalija Prasnikar

    suggestion for 2 new su forum: AI usage and AI coding

    No, but that is apparently what you are suggesting is enough. Maybe I got what you are saying wrong. But there is way more to code than being able to compile it.
  6. Dalija Prasnikar

    suggestion for 2 new su forum: AI usage and AI coding

    Ah... if it compiles, ship it.
  7. Dalija Prasnikar

    suggestion for 2 new su forum: AI usage and AI coding

    I would say that is a good thing. This means in the future Delphi will still have a solid base of developers who know how to write their code.
  8. Dalija Prasnikar

    Should we create forum(s) for AI?

    I selected "Existing forums are sufficient", because they definitely are sufficient and can cater for topics around using AI in Delphi. I am also monitoring all activity on this forum, so it does not matter to me whether such posts have another subforum or not.
  9. You should be very careful when doing this, because not all code logic protected with locks can be replaced with atomic operations.
  10. What do you mean by this? If there are multiple threads trying to do such atomic operation on a variable, then only single one will succeed regardless of which method is called. And one thread will always be successful. That is the whole point of atomic operation. You should also remember that in multithreading there is no guarantee which thread will be able to make the atomic exchange nor which thread will be able to acquire some lock. Even if 100 times operation happens in particular order, that does not mean that it will happen in the same order the next time.
  11. It is atomic, because only one thread will be able to make the exchange and retrieve non-nil value stored in the Src variable, provided that all other threads also use atomic exchange. The extra shuffling does not matter for atomicity as the shuffled values before the call are not related to the value stored in the Src variable (one that will be atomically exchanged by lock xchg instruction). Note that lea instruction loads the address, not the value stored in memory location.
  12. Dalija Prasnikar

    What is the best AI at Delphi

    There is no distant future in which that code will be ported to FMX. VCL is mature framework, and it requires very little work. Also you should keep in mind that IDE is also written with VCL. FMX does not suffer because VCL exists, it is the other way around. VCL received very little love, fixes and new features since Delphi became cross-platform. Don't blame VCL for that. The reasons for such choice are probably multifold. Today, I would certainly choose Delphi for cross-platform as the major problems for cross-platform have been resolved, even there are still issues which make such development harder than it should be. Again, VCL, is not high priority framework. Most of new development and features go to FMX. VCL has been a second class-citizen ever since XE2. And again, killing VCL would kill Delphi. The only thing that can kill it, is if MS ditches Win32 API support and that is not likely happening either. Am I asking for that much? Why should we be second-hand class citizens? Others have it in their editor. Why shouldn't we? If I use VSCode instead of Delphi, why not switching to VSCode permanently? (joking) Because not everyone uses AI and there are way more important features that would benefit all Delphi developers. I wish that Embarcadero would be able to work on everything needed, but the truth is that they cannot do everything and they need to prioritize. If you think that Embarcadero does not have resources to maintain VCL, then you will surely understand that. Anything AI related in IDE takes time away from other non-AI related features and lack of AI integration is not critical as it can be successfully used with the help of other tools. I am also using VSCode a lot (not AI related) when working on Delphi code and yes, I would like it better if I could avoid that and do everything directly in Delphi IDE.
  13. Dalija Prasnikar

    What is the best AI at Delphi

    We are no magicians. We cannot create code which does not exist. There is simply not enough Delphi code around for AI training. It is easy to have good coverage for JavaScript and similar where you literally have bazillion web pages available for scraping, where plenty of them virtually repeat the most common, required functionality. Pushing for more publicly available code without considering its quality, can also backfire. What we need is better non-AI code completion. If you need to generate larger chunks, then you don't have to do that directly within the IDE. Also you can easily use some other editor, like VSCode to give AI access to context and generating code, and then simply reload changed files in IDE. This works fine in both ways. This is not a showstopper. Ditching VCL would be the most stupid idea ever. It would be suicidal. There are huge amounts of code out there that use VCL, and moving all those to FMX would be impossible. And this is not just about old code, people use VCL for writing new code, too. Because they already have all the other infrastructure built around VCL. I am certainly not going to start new Windows application based on FMX, unless I really need some of its features. What could help this transition would be restructuring VCL and FMX to use common Application layer which would enable mixing VCL and FMX frameworks in the same application. However, this is also something that is not very likely to happen as both frameworks are rather mature at this point and such restructuring could have impact on backward compatibility. Maybe having support for multiple helpers in scope and opening up private parts of VCL and FMX allowing more customizations from the ground up could help in such transition. But this would be long term and slow process.
  14. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    And that is still true. This value will be available at some point in the future, when you try accessing the value. If that value is not calculated by then, the call will wait until it is. The future guarantees that you will be able to get the value at that specific point without having to worry about whether it is actually ready or not. If you want to access that value immediately, then you don't need future. If you want to avoid blocking UI, then again you don't need future, just run the code in the task or other kind of background thread. Also you should not compare Delphi with other languages that support async/await and which will not block the UI. If you want a future which works with callbacks you should not use PPL future but something else. I have one variant here https://github.com/dalijap/code-delphi-async/tree/master/Part4/24.2 TValue future
  15. Dalija Prasnikar

    Introducing My Delphi TFuture PPL For Thread Safe UI

    You don't and that is the whole purpose of blocking Future, to wait until the result can be used. If you don't want to block, then don't use future at all. Just use task instead. You are trying to solve the problem that does not exists. Task is async, future is just a blocking task. Trying to make PPL future async is pointless.
×