Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. David Heffernan

    Is it bug? (type inference)

    You missed the point. I'm not disputing that the variable is Extended. I'm discussing the terminology decimal, binary, floating point and fixed point.
  2. David Heffernan

    Is it bug? (type inference)

    That's even worse! Currency is decimal fixed, but Single, Double and Extended are all binary float! Probably you are trolling me now for fun!
  3. David Heffernan

    Is it bug? (type inference)

    Currency isn't a floating point type, it's a fixed point type. Sorry to be so pedantic, but you know me on this topic......
  4. David Heffernan

    Is it bug? (type inference)

    This is clearly a bug. Check if there is a bug report in QP, and if not submit one.
  5. David Heffernan

    Traybar application, get the last active windows on desktop

    It uses a timer to poll and therefore is likely to be unreliable
  6. Consequence of your decision to use an ancient tool. Upgrade to modern delphi.
  7. David Heffernan

    New to JSON

    There are lots of articles and resources and examples on JSON parsing on the web. What have you found and what have you tried. Did you start by parsing a very simple bit of JSON first. You shouldn't try to learn something new by trying to solve your ultimate problem. Start simple and work up.
  8. David Heffernan

    Traybar application, get the last active windows on desktop

    I think that when windows are activated they are also told which window is being deactivated to make this window activate. Perhaps that's what you need.
  9. David Heffernan

    Compiler detecting repeated lines?

    What if the function has side effects?
  10. David Heffernan

    Unit testing for beginners

    I don't think it is this simple though
  11. David Heffernan

    Unit testing for beginners

    That doesn't make sense. You seldom attempt to write tests that exercise all combinations. That's the art of testing, finding a good set of test cases that are concise enough to verify, yet broad enough to provide comprehensive coverage.
  12. David Heffernan

    Unit testing for beginners

    And then proceeds to offer six bullet points of advice! I think that there is a lot more to unit testing than meets the eye. Unit testing is clearly about proving correctness of your code at the time you write it. It's also obviously about ensuring correctness of the code in the future in the face of modifications to code, refactoring etc. But I think what is often overlooked is that unit testing (and indeed other forms of testing) is very much about defining what your code does, pinning down the contract between the code and its clients (fancy word for the things that call the code under test). Well written tests can provide clear documentation of the code under test. This can be extremely useful when you need to remind yourself what a particular piece of code does. The implementation of the code may be hard to read and extensive. The documentation of the code may be sparse or non-existent. But a well-written test can provide the information you need to fully understand what you can expect a function or class to do. Furthermore, I routinely find that when I write tests, especially with this perspective of a test as documenting the contact, that I am unhappy with the original implementation and the contract that is implied. I will then refactor the code to achieve the contract that I want. This implies that testing early is good. Test driven development takes that view to the ultimate of writing tests before the code. But even if you aren't going that far, write tests as early as possible. Then when you discover that the contract isn't ideal, you can change it and reduce the impact of that change. Change to design always has smaller impact the earlier it is done in a design process.
  13. David Heffernan

    One-button app to stop all explorer windows from flashing.

    Perhaps the behaviour is caused by the manner in which you create these windows. We don't know that.
  14. David Heffernan

    Unit testing for beginners

    You don't need a Delphi specific text to learn about unit testing. In fact I expect that the best texts won't be Delphi specific.
  15. David Heffernan

    A nice scaled false bug in Delphi 11 update 1

    What value does the form's Position property have?
  16. David Heffernan

    Pos, SplitString

    Your Pos statement will find FOR SELECT so will call Open. But you say ExecSql is called. What you describe happening doesn't match the code therefore. I am confused. Also SQL is case insensitive but Pos is not.
  17. David Heffernan

    Patch for Delphi 11 Alexandria available

    Uwe is providing useful information that your problem may have an environmental aspect to it. Your antagonistic response is very counterproductive.
  18. David Heffernan

    Hot Reload in Delphi?

    Perhaps this is just the final confirmation of the end of days for Delphi, if Verity Stob isn't producing new Sons of Kahn material, then does Delphi really exist?
  19. David Heffernan

    Hot Reload in Delphi?

    Also, Verity Stob!
  20. David Heffernan

    Hot Reload in Delphi?

    I think this controversy was well covered at The Register, I'd read their articles if you are interested
  21. David Heffernan

    Hot Reload in Delphi?

    Great to see that MS has done the right thing here, although disappointing that it took so much pressure to make it happen. Good on El Reg for their reporting on this. Never ever going to happen for Delphi though!!
  22. Did they return the money that customers paid? If not, what did they do with it?
  23. Didn't they announce a few years ago that they would maintain a number of older versions with important patches, for some time after release of major upgrades, but then never did.
  24. 13.98 can't be exactly represented in a binary floating point type like double. What you can do is store the closest representable number to 13.98. However, unfortunately Delphi's library code that converts between decimal text and binary floating point is rather poor and has fallen behind just about every other mainstream language. The documentation you link to is pretty flawed too because it doesn't acknowledge representability. What problem are you trying to solve? Are you working with currency for instance? In which case binary floating point is not what you need.
  25. David Heffernan

    CharInSet revisited (again)

    I doubt you will achieve better than 0.1% improvement though. That said, I do want the compiler to do a better job producing efficient code. It shouldn't be getting in our way.
×