Jump to content

ConstantGardener

Members
  • Content Count

    52
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by ConstantGardener


  1. 39 minutes ago, Lars Fosdal said:

    ... appear to be nice at first glance, but they tend to be confusing.

    I'd recommend unique names for each constructor instead.

    ...good point, especally when your Code Insight is broken. :classic_wink:


  2. 29 minutes ago, Dalija Prasnikar said:

    The advantage of passing all required data as parameters during construction process is that you cannot accidentally forget to initialize some required field. If some fields are optional, then you can stick to initializing through properties, but using simplified examples before this last one.

    ...or you can use default parameters or even overloaded constructors with different parameters.

    • Like 2

  3. 4 hours ago, Anders Melander said:

    I'm often working on applications where it can take 5-10 minutes to launch the application and navigate to the point of interest. Hot reload could save me hours every day.

    Here not 5-10 minutes, but 2-3 minutes. Without question , hotload can save us hours, but in c++ it can save days. 🙂 That's the whole point. 


  4. 4 hours ago, hsvandrew said:

    In my opinion hot reload is probably the most significant improvement to development since the Delphi IDE made VB look ancient.

    Developers are very expensive, and there are never enough hours in the day. 

    For some reason developers spend all day making productivity tools for others, but seem to still work with spades instead of bulldozers.

    I can see this feature being worth at least $5000USD/year/developer which is a game changer.

    The fact the Delphi community doesn't see how important this is, well, it says a lot. 

    On the other side: when you take the compiletimes of c++ into account the hotreload is of more interest in this ecosystem then in delphi.

    • Like 1

  5. This may be the case for very complex projects, but when the Tooltip show's you the right file and classname and an Ctrl+click shows you nothing (don't open this file/class) in a not so big project (build's in 17 sec)? This drives me crazy!


  6. On 10/14/2021 at 8:48 PM, Bill Meyer said:

    Whether it improves compile time depends on just how many Unit Dependency Cycles you have. In a large legacy project, it can be a very large number, and reducing that number can greatly help with build time. Also not, "build" not "compile". 

    from @Vincent Parrett in another thread about 10.2.4 LSP : "If the code is too complex for the tooling, then the tooling needs improving, valid compiling code should not be a problem." 

     

     


  7. function ResponseWithScaledJPG (const AFilename : string; var Response: TIdHTTPResponseInfo) : boolean;
    var     JPEGImg      : TJPEGImage;
            AStream      : TStream;
    begin
      result:=false;
      if FileExists (AFilename) then
       begin
        AStream := TMemoryStream.Create;
        JPEGImg := TJpegImage.Create;
        try
         JPEGImg.LoadFromFile(AFilename);
         if JPEGImg.Width<500 then
          JPEGImg.Scale:=jsFullSize
         else
          if JPEGImg.Width<1000 then
           JPEGImg.Scale:=jsHalf
          else
           if JPEGImg.Width<2000 then
            JPEGImg.Scale:=jsQuarter
           else
            JPEGImg.Scale:=jsEighth;
         JPEGImg.SaveToStream(AStream);
         result:=true;
        finally
         JPEGImg.Free;
         Response.ContentType := mime.ImageJPeg;
         Response.ContentStream := AStream;
        end;
       end;
    end;

    ....use this as base for your own solution. This function is from a little INDY webserver for responding with scaled pic's to jpeg-requests for limiting the traffic payload. 

    • Like 1
×