-
Content Count
1111 -
Joined
-
Last visited
-
Days Won
96
Everything posted by Dalija Prasnikar
-
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
I am critical, because you are seeking collaboration and your attitude is making more harm than good. Not just for your particular request, but it is undermining other efforts in similar areas. I am not stranger to saying harsh words, but there is a difference between backing your words with actual arguments and empty phrases like "we love Delphi more than you do". Feel free to criticize me when I do something wrong. I have no problem with that. I am an atheist and God has no meaning to me. For my actions I will be and I am accountable in this life only. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
It does not matter how old it is, it matters that things can change . Just like deprecating ARC at some point seemed highly unlikely. And for the record that is the change I didn't wished for. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Baby steps If bug report is open, it does have greater chances for being fixed than if it is closed. Also not all bugs are easily fixable. But one of the greatest issues, that for long period seemed like it will never happen, was introducing 8bit strings to all platforms. If nothing else, this makes me hopeful. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
And here your splendid personality jumps out again. Yes, I made a mistake. People do that, you know, regardless of experience. After being knowledgeable in your field of work, ability to recognize and admit your own mistakes is one of important qualities for successful developers. If one is not able to own his own mistakes it is hard to expect that such person will allow others to make mistakes without making too much fuss about it. Your response shows that either you don't have that quality or you have really short fuse. And neither makes you a wonderful team mate. And If you read my response you will see that I didn't included SWIG library (two and some years old) - I simply overlooked it. Last time I had to use C++ with Delphi was 8 years ago and it was no fun. I am glad that landscape has changed in that regard. Delphi ecosystem is not huge (no matter how much we would want it to be), and ability to interact with libraries written in other languages can make a whole world of difference. You don't want to reinvent hot water if it is already out there. Also, you might use other toolsets besides Delphi and utilizing same libraries across those toolsets also counts a great deal. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Serious question. So far you have managed to volunteer other people to do the compiler fixing. But you haven't told us anything about what can you offer in that regard? How can you help improving and fixing the compiler? What are your skills? -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
First tool explicitly mentions it is not for translating C++ header files Another excellent tool which utilize CLang to convert C (not C++) header files to Delphi: https://github.com/neslib/Chet Second tool description says This tool will convert most of your standard C code. So, yes C, no C++. For using C++ you need to go extra mile: http://rvelthuis.de/articles/articles-cppobjs.html -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Just for the record C is not C++. Joseph Mitzen didn't exaggerated that. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Agreed. There is no need for others to sabotage anything. You are perfectly capable of sabotaging both the proposal and this discussion on your own. -
Issue with code-editor toolbars
Dalija Prasnikar replied to PeterPanettone's topic in Delphi IDE and APIs
Yep. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Without going into deep discussion about compatibility and other technical issues... AFAIK Marc Hoffman would rather drop dead than sell anything to Embarcadero... -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
Core issue is in LLVM https://bugs.llvm.org/show_bug.cgi?id=1269 While in theory it would be possible to address this issue from Delphi side, it is probably as hard as solving it on LLVM side for the similar reasons. The most prominent issue is in capturing exceptions raised from accessing nil references, and addressing this particular use case would probably be simpler than all encompassing solution. However, I am not in position to say how easy or hard would be to implement this kind of fix in Delphi compiler. -
Delphi compiler need to be opensourced
Dalija Prasnikar replied to AlekXL's topic in RTL and Delphi Object Pascal
No. Only iOS and Android are LLVM based. http://docwiki.embarcadero.com/RADStudio/Rio/en/Delphi_Toolchains AFAIK first Linux release (Tokyo) was also LLVM. And you don't want to have LLVM on other platforms for few reasons. Not only it is slower than "old" handcrafted Delphi compiler, more importantly LLVM cannot handle exceptions in way Delphi compiler does. Using LLVM on desktop would break a whole a lot of code. You can fin more at https://dalijap.blogspot.com/2018/10/catch-me-if-you-can.html -
Initialize local variables at declaration
Dalija Prasnikar replied to PeterPanettone's topic in Delphi IDE and APIs
If everyone stays away, bugs will never be found and fixed... I have used them a lot in various shorter and longer experimental code... so far so good (in spite known bugs) -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
Another thing... you are asking confirmation for some design approach that didn't feel right at the end. If it does not feel right, there is probably something wrong and it is quite likely that composition would be better choice. If composition solved your problem, probably it IS the right choice and the next time you encounter similar situation it will probably be right choice again. But, without seeing actual code and knowing the context in which it will be used, it is really impossible for us to say one way or the other. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
Err.... No... You started with prefer, now you have come to always... and you are conditioning yourself to use composition without considering inheritance... you should consider both at the same time. There are always trade offs and you have to take those into account. If you start with composition and say, OK composition can solve this problem, I am all done, at some point you will make wrong choice because sometimes inheritance will be better fit. Now, I could be wrong, I don't know what is in your head... The more skill one has.. the easier is to decide... Sometimes you will just take a glimpse on some problem and you will immediately know what is the proper solution... but just because you are able to decide fast, that does not mean that you didn't fully considered all consequences of particular solution. Again, while rules help you have to be careful with the rules. They cannot save you from thinking and using the best tool for the job. I don't know how many times I used inheritance over composition or vice versa, I am not counting... it is irrelevant... even if 90% of the time composition is better, that still leaves you with 10% where it is not. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
It is problem with bad inheritance. Like I previously said, if you take narrow approach and only focus on Circle IS specialized case of Ellipse, you are bound to make a mistake. Even more so, if you lock particular behavior in base class that cannot be universally applied to all sub-classes. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
No I didn't miss it. But code reuse is separate matter. It is not a primary drive. Code reuse plays significant part in OOP design - you don't want to unnecessarily repeat code, but you also don't want to make your choices solely based on code reuse. Whatever you do, you always must look at the problem from many different aspects and all basic OOP principles. If you take too narrow approach, you will most likely make wrong choice. Sometimes, answer to inheritance vs composition for code reuse is neither, because doing one or the other can result in monstrosity. Sometimes, repeating two lines of code and keeping things simple is more viable approach. So back to your question and original article - "If it's only about code resue" Answer depends on how you interpret the question... it is never ONLY about code reuse... but if reusing some lines of code IS the only reason to use inheritance, then you are probably doing that part wrong... at the same time composition in such case can also be wrong choice. Depends what is the purpose of that code and its function. If you cannot clearly define its responsibility then you are bound to go wrong with composition, too. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
That is why there are no clean and absolute rules. You have to decide what makes sense in each particular case. Sometimes creating wrapper classes that will expose only valid functionality makes sense, sometimes list is just a list. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
Interfaces don't have implementation, so if you want to reuse code you either have to use class inheritance or you must use composition. IS-A and HAS-A rule can help you determine whether inheritance makes sense in a first place. If IS-A rule is satisfied, then you have to see whether in that particular case you should use class inheritance or composition. When it comes to creating God objects, they break other OO principles. Composition is preferred - problem with that approach and your original question "Prefer composition over inheritance for code reuse?" is that people tend to interpret it like NEVER use inheritance. And then they go down the different rabbit hole. -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
Not exactly... there are slight differences in behavior. Not that this part matters when you are choosing between inheritance and composition (as general term) -
Prefer composition over inheritance for code reuse?
Dalija Prasnikar replied to Edwin Yip's topic in Algorithms, Data Structures and Class Design
It always depends on particular situation. Both composition and inheritance have their place. Sometimes you can use either, sometimes there is a clear distinction. Some tips that can help you decide. IS-A - inheritance - Sword IS-A Weapon so Sword should inherit Weapon HAS-A - composition or aggregation - Unit HAS-A Weapon so Unit can be composed with Weapon object With simple classes that satisfy IS-A condition plain inheritance will do. With more complex classes, you may want to use composition or delegate some behavior to other classes, especially if that behavior can be reused independently. Delegation - delegate behavior to another class when it is not an objects responsibility to implement behavior on its own Composition - when object is gone the composed objects are also gone - when Pizza is gone so are the ingredients Aggregation - class is used as a part of another class, but still exists outside that other class - when Unit dies Weapon still exists -
Check for override
Dalija Prasnikar replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
That change was not worth while even back then. You had two variants for Seek and it was very easy to use wrong one. If you used 32 bit one on streams that support 64 bit your code would only work for streams smaller than 2GB. Change didn't affected older code, but it had permanent negative effect on new code. I encountered such bugs myself, and also have seen others bumping into it on numerous occasions. Yes, at the end our code was at fault, but it was really easy mistake to make. There was several bug reports around that issue at the time in old Quality Central. -
Check for override
Dalija Prasnikar replied to Jacek Laskowski's topic in RTL and Delphi Object Pascal
YES, backward compatibility matters. But in cases where backward compatibility causes more trouble down the road, then it is not worth the price. In this case, maintaining backward compatibility also opened TStream and descendant classes to subtle bugs when working with streams larger than 2GB. -
Delphi 10.3 and the NOX emulator running Android 7
Dalija Prasnikar replied to Yaron's topic in Cross-platform
If your Note 8 has Oreo 8.0 OS then debugging does not work because Google screwed up on OS level. You need to update OS to 8.1 that fixes the issue. It was not something EMBT could fix. http://blog.marcocantu.com/blog/2017-december-delphi-android81-debugging.html -
10.3.1 has been released
Dalija Prasnikar replied to Martin Sedgewick's topic in Delphi IDE and APIs
To some extent theming has a purpose because without it you could not have dark theme. Problem here is that Delphi (VCL Styles) based theming is just horrible since day one (even before it was introduced in IDE). Instead of VCL Styles being fixed and then used at large, EMBT choose to use VCL Styles without fixing issues. Another problem is not that just in theming itself, but revamping Options dialog layouts without making proper alignment/size adjustments - so everything visually just falls apart.