Jump to content

Anders Melander

Members
  • Content Count

    2297
  • Joined

  • Last visited

  • Days Won

    119

Posts posted by Anders Melander


  1. 4 hours ago, Stefan Glienke said:

    You can use aggregation and delegation of those interfaces

    I can't really tell from your statement if you're saying that he doesn't do that but should or if you're just stating a general principle.

    From the code posted it's not possible to see if the implementation uses aggregation and/or delegation.

     

     

    2 hours ago, Emil Mustea said:

    It's a better way [...] to use  aggregation and delegation

    No. It's another way.

    Which is better depends on many factors and we can only guess since we don't know anything about the architecture or size of Clément's application, and it's not really relevant to the question asked.

     

    In my experience an application has to reach a certain size and complexity before it's worth even considering the overhead and added complexity of SRP. And even then I would only apply it if it solved an actual (present or near future) problem.


  2. 10 minutes ago, Kas Ob. said:

    Very interesting. Thanks for the pointer.

    One of the other answers explains it even better IMO and points to this gem: https://kjellkod.wordpress.com/2012/08/08/java-galore-linkedlist-vs-arraylist-vs-dynamicintarray/

     

    I guess I'll have to revisit some of my old code and redo the benchmarks.


  3. 2 hours ago, PeterPanettone said:

    Did you get this from a book or is this your own idea?

    That's a strange question.

    It's based on the experience that unnecessary nesting makes the code harder to read.

    Sure it's a personal preference, some like it, some don't (just google Early Return - I'm sure you will find one or two that doesn't advocate it), but at least one of your "if" blocks are complete superfluous and would be removed by the optimizer if it was worth anything.

     

    2 hours ago, PeterPanettone said:

    BTW, Pascal Expert found 0 issues

    What's the relevance? Are you saying that because some simple rule based validator doesn't flag your code then it can't be improved? - Because I can spot several goofs in it.

    • Like 1
    • Haha 1

  4. Yes, but you can't.

    I don't know the history behind it but I can see arguments both for and against having actions disabled if there's no handler and maybe that's why they decided to make it optional. Maybe not making it published was to avoid having the noobs shoot themselves in the foot with it. I don't know (and I don't care which is why I tried to delete my question after I asked it 🙂).

    It's a very minor annoyance that can easily be worked around with an empty OnExecute handler so I don't really care about it anymore.

    Submit a change request if it's important to you.


  5. 1 hour ago, Vincent Parrett said:

    Then you would have 2 copies

    I'm way past caring about disk space.

    For example we use DevExpress in almost all desktop projects and in addition to the regular install, which we need for design time support, help, examples, etc., each project has a complete copy of the DevExpress source files to make sure the projects are autonomous, under full revision control and are always built with the correct version. That's 120 Mb in 3000 files - per project, per branch, etc.

     

    Yes, a global package cache could reduce that to a single copy, but it would be pointless. The problem we have isn't disk space. It's creating a reliable, robust and foolproof development environment.

     

     

    27 minutes ago, Vincent Parrett said:

    At some point you have to reference the location of the source/lib files,

    Yes, but I would prefer to have complete control over where that exact location is.

    I'm not saying that it's unreasonable to require at least some adaptation of a project for use with DPM but for me at least it will be a showstopper if use of DPM becomes a requirement once the project has been adapted and having the package cache in the project search path, and the search path controlled by DPM, is such a requirement as far as I can tell.

     

    I guess right now I'm focusing on how DPM could fit in with my existing projects where I already have all dependencies sorted out and folders and search paths assigned.

    I understand the use cases of dependency resolution, the package cache and updating the search path, but I'm not sure the convenience they offer is worth sacrificing the autonomy I already have in place for the projects I manage.
    Now if only DPM had been a standard part of Delphi then it would have been an entirely different matter.

     


  6. 4 minutes ago, Vincent Parrett said:

    It's one copy

    I would have preferred it to be zero or one copies: The package cache would just contain the meta data and optionally a single copy (per version) of the source files.

    On update the package manager would copy the specified source files to a local folder specified in the project options.

     

    This way there would be no dependency between the project and DPM and the the project would be completely autonomous. As far as I can tell, the system you have now creates a dependency between the project and DPM because the project search path has to include DPM specific folders - local or not.

    There's also a duplicate binding between the project and the package version because the version is specified in both the dpm.config file and in the project search path. It should be sufficient to specify the version in the config file.


  7. 7 minutes ago, Wagner Landgraf said:

    It should be one copy shared by all the 100 projects, which will just reference the same library.

    That's not my understanding. As I read it the package cache can be either global or per project.

     

    Regardless I can't see the problem of each project having their own copy of dependent libraries - unless it's the JCL in which case even a single copy is a problem 🙂

    Disk space is cheap. Time is not.


  8. 3 hours ago, Soji said:

    Is there any other solutions available?

    No.

     

    But while you're peeking at the message queue you might as well do something useful with it:

     

    procedure BusyBusyBusy;
    begin
      // Allow threads to synchronize 
      CheckSynchronize;
    
      Msg.message := 0;
      try
        // Process cursor update messages for this window so cursor stays responsive
        while (PeekMessage(Msg, Handle, WM_SETCURSOR, WM_SETCURSOR, PM_REMOVE)) do
        begin
          if (Msg.message = WM_QUIT) then
            exit;
    
          DispatchMessage(Msg);
        end;
    
        // Process paint messages for all windows so UI can repaint itself
        while PeekMessage(Msg, 0, WM_PAINT, WM_PAINT, PM_REMOVE) or
          PeekMessage(Msg, 0, WM_ERASEBKGND, WM_ERASEBKGND, PM_REMOVE) or
          PeekMessage(Msg, 0, DXM_SKINS_POSTREDRAW, DXM_SKINS_POSTREDRAW, PM_REMOVE) or
          PeekMessage(Msg, 0, WM_PRINT, WM_PRINT, PM_REMOVE) or
          PeekMessage(Msg, 0, WM_PRINTCLIENT, WM_PRINTCLIENT, PM_REMOVE) do
        begin
          if (Msg.message = WM_QUIT) then
            exit;
    
          DispatchMessage(Msg);
        end;
    
        PeekMessage(Msg, 0, WM_NULL, WM_NULL, PM_NOREMOVE); // Avoid window ghosting due to unresponsiveness on Vista+
    
      finally
        if (Msg.message = WM_QUIT) then
        begin
          PostQuitMessage(Msg.wParam);
          Application.Terminate;
        end;
      end;
    end;

    The above was snipped from existing code so might need to be tweaked slightly.

    • Like 1
    • Thanks 1

  9. On 11/27/2019 at 8:15 AM, dummzeuch said:

    About digitally signing the installers (and probably the executables): I've never done that. As I understand it, it would require a certificate which

    1. Costs money

    2. Is valid for a limited time only

    3. Then will cost money again to renew

    Completely OT but in Denmark every citizen has a personal certificate issued by the state for verification of online identity etc. This was introduced 20 years or so ago.
    In theory this certificate can be used for code signing (and I used to do so) but about ten years back the state outsourced the whole operation, implementation and infrastructure, to a private company (Nets DanID) which then introduced a solution called NemID (rimes with GlemID and SlemID = ForgetID and BadID). NemID is still based on certificates but it's so idiotically implemented that both the public and private keys are stored on the Nets servers. In other words: I don't have access to my own private keys and I have no control over who has access to them.
    Sorry. I get really pissed off every time someone mentions certificates 🙂

    • Haha 1
    • Confused 1

  10. New version released: v1.0.7271.54299
    http://melander.dk/download/amTranslationManagerInstall-1.0.7271.54299.exe

     

    Changes since v1.0.7254.4932

    New features:

    • GNU GetText PO file import.

    Improvements:

    • Copy to clipboard not uses tab delimited CSV for better integration with Excel.
    • Normalization rules can now be configured.
      image.png.aad69b1af05f9b228fa5f197df6b76da.png
    • New validation rules: pipe | and surround ()[]{}<> mismatch.
    • Validation warnings can now be dismissed and resolved.
      image.png.53c58cfe404ffa5c1531a1bbee9a02c9.png  image.png.45d3e3d3e1505421e3beda34772220b6.png
    • New equalization rules: Leading space and Trailing space.
    • Duplicates in Translation Memory lookup results are now ranked by the similarity of the translation source to the value being looked up.

    Other:

    • Installation of the command line tool is now optional.
      Primarily because it is currently being flagged as a false positive by several virus checkers.
    • Removed dependency on midas.dll
    • A slew of performance and usability improvements and bug fixes.

     

    Thank you to all those that have sent me suggestions, feedback and bug reports.

    • Thanks 5
×