Writing code for a reader

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37472
    HeDiBo
    Participant

    Let me say first that I have the highest regard for you and your work.

    Therefore, please understand that the following comment is only meant as positive criticism.

    Everywhere in your components I found the following constructs:

    Code:
    property Margin: integer index 0 read FMargin write SetInteger default 0;
    property ColorRectHeight: integer index 1 read FColorRectHeight write SetInteger default 14;
    property ColorRectWidth: integer index 2 read FColorRectWidth write SetInteger default 21;

    If one of my programmers would come up with this, I would ask him (I never had the pleasure working with female programmers) why he wrote this incomprehensible code. I guess his answer would be that it made the source volume smaller. My answer would be that to make the code as small as possible, he should write in LISP. That would make the code really totally blurred.

    The point being, that I would prefer large and heavily commented easily understandable code any day.

    I have asked you this before: because there is no recent documentation, the only fall back we, as users of AC, have is the actual source code. So I urge you to make that code as understandable as possible. AC is a very complicated set of components with, in many instances, unique ways of doing things. Please, don't make things more difficult than needed unsure.gif

    #56613
    Support
    Keymaster

    I'm sorry, I didn't think this code is incomprehensible…

    Code is not only smaller, all repeated code is contained in one procedure, it's more handy for changing or for debug for me.

    And very handy for adding of new properties (part of a code exists already).

    Do you mean, indexing of properties with equal setters or getters is a bad idea? Why this code is not incomprehensible?

    #56620
    HeDiBo
    Participant
    'Support' wrote:

    Do you mean, indexing of properties with equal setters or getters is a bad idea? Why this code is not incomprehensible?

    Maybe if the index would have symbolic names, it would be better.

    But this was only an example.

    In general the code should be so easy to read, that a manual would be superfluous. That would accomplish two things: a very maintainable source code and a very good reference text for your users. As it is now, all efforts are made to shrink the source code. I even saw this in the transition of 12.06 to 12.07:

    Code:
    .
    .
    else
    inherited;
    .
    .

    was changed into

    Code:
    .
    .
    else inherited;
    .
    .

    Why? Do you really think the latter is more readable? I give it to you that readability of the source code was never a goal. However, my many years of experience taught me that readability is the prerequisite for maintainability.

    Don't get me wrong. I love AC. It's because I want it to be most successful that I take the time for such critics.

    Keep up the good work a7.gif

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.