Jump to content

David Heffernan

Members
  • Content Count

    3586
  • Joined

  • Last visited

  • Days Won

    176

Everything posted by David Heffernan

  1. David Heffernan

    Pitfalls of Anonymous methods and capture

    It's a typo. Should be SSCCE: http://sscce.org/
  2. David Heffernan

    How to switch condition position?

    The point about the order was to be sure that the condition was evaluated. Consider the two settings for the switch: 1. Left to right, condition is first sub expression, therefore it is evaluated. 2. Complete eval, all sub expressions are evaluated, therefore it is evaluated. QED
  3. David Heffernan

    How to switch condition position?

    You can count on it. http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Expressions_(Delphi)#Complete_Versus_Short-Circuit_Boolean_Evaluation Very surprised you don't know this.
  4. David Heffernan

    How to switch condition position?

    Nothing to do with implementation details. The Python syntax is simply the Python equivalent of the C conditional operator. You know, the operator that is missing from Delphi.
  5. David Heffernan

    Pitfalls of Anonymous methods and capture

    It's an extra step for every one of your readers. In fact it's multiple steps. Down file. Unzip file. One goal of the writer is to make it easier for the reader to see and understand. For instance, if I was on a mobile device how would I read files in a zip file?
  6. David Heffernan

    How to switch condition position?

    That's certainly more concise but it has a completely different meaning. Think about it Rudy.
  7. David Heffernan

    How to switch condition position?

    Seems kind of a waste of time this entire discussion. The language is well documented and is quite concise. The are only a handful of conditional statements. The syntax for if is clear. You have to write the code in the language that is provided to you. Use an if statement. End of story.
  8. David Heffernan

    How to switch condition position?

    So you know the answer
  9. David Heffernan

    How to switch condition position?

    What does the documentation say?
  10. David Heffernan

    Pitfalls of Anonymous methods and capture

    I'd still see all the replies. It's an interesting topic that you raised but it needs a clearer example to bring out the issue.
  11. David Heffernan

    appending to a dynamic array

    The subject is dynamic arrays and not open arrays.
  12. David Heffernan

    Pitfalls of Anonymous methods and capture

    Whatever. The text in the blog post didn't make the types clear. I wasn't about to download some project from a file sharing site. It's quite easy to make a complete program in a simple console app. There must be a few posts on this topic out there already.
  13. David Heffernan

    Pitfalls of Anonymous methods and capture

    If we have no knowledge of the types involved in this code then for sure we can't know what's wrong with it.
  14. David Heffernan

    Should my record be a class instead?

    Nothing in that that suggests there is a need for a global variable.
  15. David Heffernan

    Should my record be a class instead?

    You claim that these global variables "need to be global". Why is that? It would not surprise me if it turned out not to be the case.
  16. Yeah, seriously you should remove this. As far as the question, I guess you need to decide on exactly what you want to implement. Security concerns are seldom as easy as "just add a signature". You see a lot of people who want to implement security without a solid understanding and it usually ends badly.
  17. What is Acrobat doing there? Is it a certificate is the security sense, or is it just an image? Now that we have your signature in the image in this post, can't we sign things and pretend to be you? If I steal your cheque book, can't I sign them now as you?
  18. David Heffernan

    operator overloding Equal vs Multiply

    Methods aren't normal functions by that argument, so why are open array parameters fine for them? The real problem here is the decision to allow literals to have type determined by context. So [10] is either a set or an array. That is incompatible with other language features. Like method and operator overloading. There is a good reason why other languages don't attempt to infer type of literals from context.
  19. David Heffernan

    operator overloding Equal vs Multiply

    In this circumstance, for testing equality, why do you believe that a function is better than an operator?
  20. David Heffernan

    operator overloding Equal vs Multiply

    It feels wrong isn't much of an argument. If open array arguments are fine for functions why not for operators, which are just functions with syntactic sugar. Can you explain your objection with reason, rather than relying on what it feels like. And surely you understand why operators are often preferred to functions.
  21. David Heffernan

    operator overloding Equal vs Multiply

    Operators are functions. There are certainly times when it might be useful to use arrays as operator arguments. I regret that the language designers have allowed literals to have meaning determined by context in various places. When there is insufficient context, as is inevitably the case on occasion, these kind of problems arise.
  22. The design error is converting left button up into click. That's what Sertac said. Read his comment carefully. A click is button down, capture, button up.
  23. This was already covered on SO https://stackoverflow.com/questions/54401270/when-i-perform-the-ondblclick-event-form1-to-open-form2-it-fires-the-oncellcl If you are going to cross post, please note the other places that you posted so that people don't duplicate work.
  24. David Heffernan

    Is it really good practice to create Forms only as needed? Always?

    Doesn't sound like resource exhaustion is to blame. More likely plain defects in your code.
  25. David Heffernan

    Is it really good practice to create Forms only as needed? Always?

    You don't need to keep forms alive to preserve settings because you don't store setting in form instances. You store them elsewhere.
×