Jump to content

David Heffernan

Members
  • Content Count

    3536
  • Joined

  • Last visited

  • Days Won

    175

Posts posted by David Heffernan


  1. On 6/11/2020 at 9:43 PM, Mahdi Safsafi said:

    Wasn't said explicitly ... but RTTI is available for public declaration. dpr project (program/library/console,...) are implementation (they don't have interface) those they are not public.

    program Project1;
    
    {$APPTYPE CONSOLE}
    
    uses
      System.SysUtils, System.Rtti;
    
    type
      TMyClass = class
      public
        procedure Foo;
      end;
    
    procedure TMyClass.Foo;
    begin
    end;
    
    procedure Main;
    var
      ctx: TRttiContext;
      Method: TRttiMethod;
    begin
      Method := ctx.GetType(TMyClass).GetMethod('Foo');
      Writeln(Method.Name);
      Writeln(Format('%p', [Method.CodeAddress]));
    end;
    
    begin
      try
        Main;
      except
        on E: Exception do
          Writeln(E.ClassName, ': ', E.Message);
      end;
      Readln;
    end.

    This demonstrates that what you said is not correct.


  2. 23 hours ago, Scott said:

    Seems like Embarcadero need to increase their Beta testing pool

    Beta testing is no substitute for having your own comprehensive set of automated tests. Beta testing is best used to help identify issues with design. It really shouldn't be used to find implementation bugs. I hope that Emba don't do that.

     

    When Emba tell us that they are going to focus on quality, it comes with talk of how many QP issues have been resolved. But for me that misses the point. Unless they are also fixing the development process that allows so many bugs, they will remain stuck on the treadmill, running to stay still. 

    • Like 8

  3. 16 minutes ago, Mahdi Safsafi said:

    Wasn't said explicitly ... but RTTI is available for public declaration. dpr project (program/library/console,...) are implementation (they don't have interface) those they are not public.

    RTTI is available for all types, be they public (interface section), or private (implementation section or project file). 


  4. 1 hour ago, Benmik said:

    It was by no means meant that way. On the contrary, like everybody else I admire and cherish your capabilities as a programmer, but feel bad every time I witness you treating people badly for minor reasons. I pity this, no more and no less.

    It just goes to show how easy it can be to misinterpret what people mean.


  5. 22 minutes ago, Mahdi Safsafi said:

    Worse they follow grammar mistakes and embarrasses the man in a way (you missed 's', he/she/it ... come on !, ...).

    I don't think there's any point in picking up those things. I mean edit a post to resolve them, but no need to comment on them. 

     

    23 minutes ago, Mahdi Safsafi said:

    When you talk with your Doctor, the Doctor is confined by deontological ethics to give you a clean, simple and loyal information. I believe that should applies on SO too (A man asks question because he is confused otherwise he wouldn't ask).

    You pay your doctor for a service. Stack Overflow is a little bit different.

     

    24 minutes ago, Mahdi Safsafi said:

    David and all SO influencers, your voice is heard ! Perhaps, you can start an initiation at least on the Delphi community (this definitely will make a difference).

    I have utterly no influence on Stack Overflow. 


  6. 8 minutes ago, Mahdi Safsafi said:

    Some of my friend refused to use SO just for a moral reason. Moreover, many developers don't agree with their policies.

    That's a valid choice. If you don't agree with the site's policies, then you can choose not to use it. 

     

    9 minutes ago, Mahdi Safsafi said:

    For many times, I saw many people get humiliated for trivial reasons by people that just enjoy doing that and SO is not doing a good job there !

    There is too much of that going on, I agree. 


  7. 11 hours ago, Benmik said:

    To mourn over a "noble mind" that has gone astray is certainly nothing that would make many people feel offended.

    It came across as patronising and gleeful. 

     

    12 hours ago, Benmik said:

    But neither great merits as a Delphi programmer nor the sophisticated use of Oxford English entitle you to treat people the way you do, especially on stackoverflow. The slightest slip and you are cracking down on the poor devils, and I might be wrong, but in my opinion it has gotten worse in the recent years

    I don't agree with that. I think anyone who says that doesn't understand Stack Overflow in the round. 

     

    There's a huge problem with Stack Overflow, but it's not what you allude to. 

     

    In the beginning the site had very little content and there was a void to be filled by asking questions. After some time the majority of questions had been asked and answered. The overwhelming use of the site is a websearch that leads to topic on the site with an existing question that matches the user's needs. Overwhelmingly users get their answers without asking new questions. 

     

    Nowadays there are basically two main form for new questions that get asked

     

    1. A question is asked that has been asked before. These get closed as duplicates. 

    2. A question is asked by a user that has done no debugging. 

     

    Closing duplicates is good for everyone.

     

    The other form of question has no real value. You can answer the question and the asker learns nothing. Or you can try to help the user learn the value of debugging and so be able to do it for themselves in the future. The site doesn't really make it easy to do this, but i firmly believe it's the right thing to do.

     

    As is well known I've spent a lot of time on Stack Overflow over the years. These days I spend very little time there, because interesting questions are so rare. I think perhaps I have a very different perspective of the site than you do given the very different ways that we use them. I think this is an interesting topic, but it's not the topic that this thread is covering. If you want to discuss Stack Overflow, then that would be better in a different thread.

    • Like 1

  8. 7 minutes ago, Lars Fosdal said:

    I just want truly constant typed constants.  It would allow me to write consistent, readable, reusable code and allow array parameters and typed constant parameters for attributes.

    A minor performance penalty would be acceptable if that goal could be achieved.

    Surely all full time delphi programmers would be ecstatic with this. 

    • Like 2

  9. 1 hour ago, Mahdi Safsafi said:

    He showed a disrespect for me

    I didn't mean to show you any disrespect.  I'm sorry that it came across that way.

     

    All I meant was that I thought the argument that compilation speed was important was bogus.  I really did not mean to upset you.  I try hard never to make anything I write personal.  To me it's always about the technical details.

    • Like 4

  10. 4 minutes ago, Kas Ob. said:

    And i might here add as suggestion to him and few others: to refrain from using the straw man fallacy https://en.wikipedia.org/wiki/Straw_man , many developer in this forum are using this broken logic repeatedly, we are not in enemy or in a contest for likes, right ?

    Please show respect, all in all there is no reason go after a person himself (by offending or disrespect) because you think he is wrong, even if he is wrong.

     

     

    I don't think that anybody here has used a straw man.

     

    And only two people have made any statements directed at an individual, rather than concentrating on the arguments.  


  11. 57 minutes ago, Mahdi Safsafi said:

    I said that any developer should avoid using typed-ordinal-type-constants(Byte, Integer, ...)  as this will impact optimization and adds an extra overhead at the compilation-time

    Compilation time is not a valid reason to make that choice. I stand by that. Your own measurements backed up my point of view.

    58 minutes ago, Mahdi Safsafi said:

    Yet he said that the test isn't a real-world test

    It wasn't.

     

    58 minutes ago, Mahdi Safsafi said:

    explaining why it's hard to an x64-toolchain to outperform an x86-toolchain

    I understand that, but there's no good reason why they shouldn't have the same relative characteristics.  So whilst the x64 compiler may well be slower than x86, the x64 compiler should not blow up when presented with huge numbers of typed constants, in a way that the x86 compiler does not.

     

    59 minutes ago, Mahdi Safsafi said:

    I said that the reason behind why Delphi's compiler not allowing using complex-type constants (e.g: array, record) as true constants was compile time speed

    A more plausible explanation to me is simply the history of writeable typed constants.

     

    At this point we all know what each other thinks, and there's little point repeating ourselves any more.


  12. The biggest issue with constants in Delphi are that typed constants can't be used in certain settings which require true constants to be used. The ones that come to mind are:

     

    1. When declaring typed constants. 

    2. When declaring attributes. 

     

    The inability to used typed constants in these settings is clear weakness in the language. 

     

    There are probably more issues, but these are the ones that bite me. 

     

    I'm tired of hearing justification for these limitations based on the current implementation. All this talk about single pass, interface vs implementation, writeable typed constants, etc. If the implementation limits you, change it. 

    • Like 2

  13. 1 hour ago, Kas Ob. said:

    David, no one suspect that you have more knowledge than many ( may be all) us here in many fields, though you can't be knowing everything all the time in every detail, so please prove you point or drop it, don't steer the subject left and right.

    And saying "i was wrong" will not make you lesser person or developer, on contrary you will gain more respect instead of losing some by offending person in person without proof, just using you reputation not your knowledge.

    A few milliseconds during a typical compilation is insignificant. That's my opinion. Others may have a different opinion. They are welcome to it.

    • Like 1

  14. 38 minutes ago, Kas Ob. said:

    Can you accept this as example ?

    Now you are talking about the generated code. Which is a different issue. Hitherto there has been a long, and in my view bogus, discussion about compilation speed. The OP said that compilation speed was a reason to prefer avoiding typed constants.

     

    The point that I made which seems to have generated such noise is merely that speed of compilation is no reason to prefer true constants over typed constants.

     

    EDIT: I didn't read closely enough. You are claiming that the compile time must be longer because more instructions are emitted? Wow, that's weird. Known to be false also. Consider optimisation. Often this results in fewer instructions emitted, post optimisation. But optimisation is an additional step that can increase compile time

     

    There are good reasons to prefer true constants over typed constants. Compilation speed isn't one of them. Efficiency of generated code is one. 

     

    Frankly I'm ambivalent about what you both think. If you want to change the way you code to save a couple of milliseconds of each compilation, then do it. It doesn't bother me. 

    • Like 1

  15. 4 hours ago, Mahdi Safsafi said:

    The code showed clearly that they do on x64!!! 

    Only for a totally unrepresentative example, and only because of implementation defects in that compiler. Not because there is anything conceptual. 

     

    Feel free to choose between true and typed constants because of a few milliseconds difference in compilation time. If that means something to you, great. Knock yourself out. For me I will stick to what results in readable and maintainable code, and code that runs most efficiently. 


  16. 26 minutes ago, Mahdi Safsafi said:

    Now, if you still insist, than you should really start giving me a good explanation -as I did- (forget about good explanation, just give an explanation or even come up with just a theory) why a typed-constant does not  add any extra overhead on the compiler/linker ?

    My point is that the difference in compilation time is insignificant, and absolutely should not drive your choices of how to write the code. 

     

    11 minutes ago, Mahdi Safsafi said:

    When you use many dll(s) ... did you notice that the startup of your app has significantly taking additional time ??? that's because the dynamic-linker (a component from the os-loader) is fixing your symbols !

    Certainly for the DLL that I ship, that's not the case. The time spent fixing up symbols isn't great because there aren't that many. 


  17. That's clearly a deficiency in the x64 compiler implementation since the x86 compiler doesn't suffer the problem. The x86 compiler demonstrates that the difference in performance is not due to a fundamental conceptual hurdle, but a poor implementation. We know that the x64 compiler performs very poorly. 

     

    In any case the test is totally unrealistic. You aren't going to encounter this in real world code. 

     

     


  18. 25 minutes ago, Mahdi Safsafi said:

    Can you give a good example on when using an ordinal-typed-constant is better than just a constant

    As I said, when I need to take the address. An example from my code base is when calling external code, written in Fortran, that expects values to be passed by reference always. 

     

    26 minutes ago, Mahdi Safsafi said:

    You don't need to measure the elapsed time

    You do. If you can't provide a real world example where compilation time is significantly impacted, then I call BS. 

     

    27 minutes ago, Mahdi Safsafi said:

    I gave the example just to show you that the reason behind not allowing a true constant for array, record, ... wasn't about the complexity of the type (they can do it at any time ... but they didn't ! not because the type is complex ... after all it's statically initialized ! if the compiler evaluated it ... it can handle it !!!!!!!). Are you convinced ?

    I'm talking about the language as it stands today. Your original post was too. 

×