Jump to content

Lars Fosdal

Administrators
  • Content Count

    3483
  • Joined

  • Last visited

  • Days Won

    114

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Exception classes implementing interfaces

    With EurekaLog, it is possible to capture and log EVERY exception before it is handled, so why bother with interfaces? We use inheritance, mostly to classify exceptions for a sub-domain. Exception - ParsingException - InvalidCSV - InvalidEmptyField try Parse; except on E:Excepetion do if E is ParsingException then LogSomethingInformative else raise. end;
  2. Lars Fosdal

    Unit testing for beginners

    Any problem can be expanded into something insurmountable if one so likes. But, if you apply the KISS and Pareto rules- you can at least start out with a less complicated scenario.
  3. Lars Fosdal

    Unit testing for beginners

    Pretty much. Add corner cases as they happen.
  4. Lars Fosdal

    Unit testing for beginners

    Just from the top of my head... 3 + -3 3 + - 3 3 +- 3 - 3 + 3 -3+3 -3 + +3 How tolerant do you want the parser to be? I wrote a parser that did math on arrays in a stock price technical analysis tool back in the 90's. I built the parser so that it generated an expression tree, so the same calculation could be done rapidly on a number of data points. I could multiply a stock price with a currency price and subtract the adjusted value from the Oslo exchange with the same listed stock on NYSE. Good fun!
  5. Lars Fosdal

    Unit testing for beginners

    It depends on the parser. Sometimes it can be just "can this string be recognized as a valid representation of a value?", other times you could parse a generated artifact, or a predefined artifact.
  6. Lars Fosdal

    Unit testing for beginners

    It would be natural that the test cases also contain negative tests - i.e. stuff that is supposed to fail. Only testing happy path = recipe for disaster. You want to know that if you get garbage in, at least your code can recognize that it is garbage, report the problem, and move on.
  7. Lars Fosdal

    awk-like processor using Delphi code?

    Dictionary and anonymous methods. Link the method to the keyword. Look up via the keyword and execute the code.
  8. Lars Fosdal

    Unit testing for beginners

    The X is for eXcellent 🙂 Edit: On the serious side, we chose DUnitX because the use of attributes allowed us to do more testing with less code. Also, it is super easy to integrate with Continua CI. Many of the tests are there to verify that we f.x. have working FromString/ToString methods for all our enumerated types, validation of algorithms, and such - but a lot of the tests are actually closer to integration tests than to unit tests. F.x. there are a large number of tests that do CRUD testing for our database objects. We should add more tests, to be honest - but so much to do, so little time, so the Pareto rule, rules.
  9. Lars Fosdal

    Patch for Delphi 11 Alexandria available

    All our apps, including our services, are self-upgrading/restarting. It has worked flawlessly for years. We set up the relaunch to be executed in the finalize statement of our upgrader unit, so we know the application has actually exited when we relaunch.
  10. Lars Fosdal

    Patch for Delphi 11 Alexandria available

    I just installed FMXLinux 1.68 which required a restart. No lingering BDS.exes for me. I keep Process Hacker running most of the time, and I can't recall seeing multiple BDS processes after a GetIt install.
  11. Lars Fosdal

    Pos, SplitString

    How about testing for 'FOR SELECT' first? Then again - what if there are two spaces between FOR and SELECT ? If you want to "trim" all spaces, you still have to avoid doing so inside string literals. Parsing can be complicated. I hope you don't plan to expose this to users, because they could wreak havoc on your database.
  12. Lars Fosdal

    Patch for Delphi 11 Alexandria available

    I haven't seen a GetIt induced restart fail yet - but now I am suddenly expecting it to fail...
  13. Lars Fosdal

    Hot Reload in Delphi?

    It has been too long since the last "Clan of Kahn" "Sons of Kahn" post 🙂
  14. Lars Fosdal

    Hot Reload in Delphi?

    The Register is definitively one of the more interesting and accurate sites on all things IT these days. Very little fluff and rumors. Edit: Here is the "wrong thing" article: https://www.theregister.com/2021/10/22/microsoft_net_hot_reload_visual_studio/ Also, the BOFH posts usually are good for a laugh and a nod.
  15. Lars Fosdal

    Hot Reload in Delphi?

    The "wrong thing" was to first introduce it to the open source libs, then pull it back - instead of keeping it private, and adding it to the open source lib later.
  16. Lars Fosdal

    Hot Reload in Delphi?

    Most of my code involves a multitude of objects in various containers and their interactions. I've never dragged the exe pointer or set the execution point during debugging, as it would most likely create conflicting data.
  17. Lars Fosdal

    Hot Reload in Delphi?

    It would be a nice feature, but it is pretty unlikely to ever happen. The .NET platform is very, very different from Win32 on Intel. The ancient Borland Pascal DOS debugger had backstep, where you could single-step backwards from a breakpoint. Also not quite as easy in the multithreaded, asynchronous world of Windows.
  18. They could have made the "Patch available" a little more prominent, as well as putting it in the "New in GetIt" and "Promoted in GetIt" panes.
  19. Lars Fosdal

    CharInSet revisited (again)

    If the values are in an int array, would it be possible to use a different kind of operation than a loop + comparison, f.x. the SIMD instructions?
  20. Lars Fosdal

    Delphi 11.0 has a different form Caption offset than Delphi 10.4

    It's a nightmare when you have 350+ frames and forms that may need a touch-up, and you still can't be sure they won't be f'd up if two people with different DPI settings edit them.
  21. Lars Fosdal

    CharInSet revisited (again)

    @pyscripter - A char in a Unicode string is a word, not a byte. The old set operator is useless for Scandinavian chars, as well as German umlauts, etc., unless you convert to ANSI - and that is not desirable.
  22. Lars Fosdal

    CharInSet revisited (again)

    That is what I meant, and you are right - how could it...
  23. Lars Fosdal

    CharInSet revisited (again)

    Does CharInSet support multi-byte Unicode characters?
  24. Lars Fosdal

    UAC request minimized instead of full-screen

    I see minimized / background UAC dialogs from time to time, and it is annoying as heck. I can't really see a pattern, though - and I can't say 100% for sure, but I don't think our own app that requires elevation have behaved like this for me. Mostly, it seems to be installers, or apps launched by installers?
×