Jump to content

Uwe Raabe

Members
  • Content Count

    2558
  • Joined

  • Last visited

  • Days Won

    150

Posts posted by Uwe Raabe


  1. 38 minutes ago, Rollo62 said:

    But on the other hand Jenkins solution is free (also a good and valid argument).

    The time saved by using ContinuaCI and FinalBuilder is worth much more than the cost for these tools - unless you are working for free, though. When comparing prices, don't forget to compare benefits, capability and comfort. Free is never an argument on its own. Oh, and the Solo version of ContinuaCI actually is for free.

     

    I tried several times to make use of Jenkins (actually I started with Hudson), but each time I gave up due to the effort necessary to get things done and the maintenance being a bit cumbersome (to speak nicely). So no one can say I didn't give it a chance.

     

    ContinuaCI has still room for improvement, no question, but @Vincent Parrett and his team are always open for feature requests and usually amazingly fast when it comes to fixing bugs.


  2. 3 hours ago, dummzeuch said:

    Am I just too pedantic?

    Talking about pedantic: The name len is probably misleading, as when it is used in MyArr[Len] it doesn't represent the actual length of the array any more. In contrast MyArr[High(MyArr)] is always correct.

     

    Nevertheless, caching the index might be a good idea anyway: It eliminates some checks - and High(x) needs one additional DEC operation compared to Length(x).


  3. In modern Delphi versions I try to combine record constructors and array concatenation to achieve that:

    program Project481;
    
    {$APPTYPE CONSOLE}
    
    type
      TSomeRec = record
        SomeField: Integer;
      public
        constructor Create(ASomeField: Integer);
      end;
    
      TMyArr = TArray<TSomeRec>;
    
    constructor TSomeRec.Create(ASomeField: Integer);
    begin
      SomeField := ASomeField;
    end;
    
    procedure Main;
    var
      myArr: TMyArr;
      myRec: TSomeRec;
    begin
      myArr := [TSomeRec.Create(0), TSomeRec.Create(1)];
      myArr := myArr + [TSomeRec.Create(2)];
      Insert([TSomeRec.Create(3)], myArr, 1);
      for myRec in myArr do begin
        Writeln(myRec.SomeField);
      end;
      Readln;
    end;
    
    begin
      Main;
    end.

     


  4. Users of ModelMaker may appreciate the availability of a Modelmaker IDE Integration Expert for Delphi 10.3 Rio.

     

    Note: ModelMaker  is a separate Native Delphi Visual modeling and Refactoring tool based on UML™ 2 technology. Not to be confused with MMX Code Explorer.

     

    More info here: ModelMaker IDE Integration Expert for Delphi 10.3 Rio released

    • Thanks 3

  5. 1 hour ago, PeterPanettone said:

    The scope prefix is very important because it removes ambiguity and it adds clarity.

    Actually, I would hate reading such code. It is distracting and extends the amount to read with no real information gain. It's a TButton - I don't care where it is declared. If I want to know I use Code Insight.

     

    6 minutes ago, PeterPanettone said:

    For example, an addon which checks for namespace ambiguity would traverse all type-identifiers in the source code and check whether any type identifier (at least those with no fully qualified namespace prefix) is implemented in more than one used unit.

    There already is such an AddIn and it is called Pascal Expert. The corresponding report is STWA2:

    Quote

    STWA2-Ambiguous unit references

    Top  Previous  Next

     

    Ambiguous unit references (STWA2)

     

    This sections lists identifiers with ambiguous unit references.

    Consider this example:

     

    image.png.28e12ad4b3f2fe7471e6ba4a18990ae2.png

     

    What will be the output from the program? In this case, it will be “Goodbye”, because the last unit listed in the uses clause will have precedence.

     

    The reference to TheValue is ambiguous or unclear, so it will be listed in this report section. Consider what happens if originally only unit “A” was listed in the uses clause. Then the output would be “Hello”. If then maybe another programmer without any sense of danger will add “B” to the uses clause, the output will be changed.

     

    You should prefix the reference, like “B.TheValue”, to avoid any uncertainty.

     

     

    • Like 1

  6. If Contains means a simple text search and given your example above, that would return the first unit where TButton is used or declared.

     

    Actually, there exists something like that in MMX used for auto adding units to the uses clause when a specific type is used (see General Settings under Parsing). Unfortunately, in my opinion, that too often gives false results, because it relies on pre-scanned units and not resolving the units found inside the uses clauses.


  7. 13 minutes ago, PeterPanettone said:

    So would you please consider adding this very useful functionality?

    Unfortunately that is way more complicated than resolving the unit scope names. It requires to find out where that identifier is declared with respect to the current scope and uses clauses. While Code Insight does have this information and therefore can offer this "Find Declaration" functionality (with all its quirks), MMX does not and it is not planned to support it. Perhaps, when somewhere in the future MMX uses some sort of compile or syntax check, this might be easier to implement. For the moment it is simply out of bounds.

     

    BTW, one of the advantages of MMX is that it usually still works even when the code does not compile. That is because it doesn't use a compiler to analyze the sources.


  8. The idea was that the search paths are taken from the current project configuration. Seems like that is not the case here.

     

    I wonder if these settings will become obsolete whenever that mechanism actually works and they are auto-updated whenever the project or its current build configuration changes. That would leave the $IF Expressions and the Lattix LDP file as the only adjustable values (not sure if the latter is actually used by anyone else than myself).

×