Hello Paolo,
when I started with Lazarus I found it great, that I could do all settings in object inspector. But after some time I realized a couple of disadvantages doing so (like you did now) and stopped this and since then I do (nearly) all settings in code. The disadvantages were (of course this is a personal view):
a) to see which properties I changed and what values I used:
In code I use 1 procedure per Form which sets all properties of all it's Controls, which need changes from defaults, always called 'setAllPropertiesFormXY'. There I can see on 1 view all what I changed from the defaults. For me this is the best overview. In the OI I had to walk through all Controls one by one and for each Control I had to do a lot of scrolling to see the same. The LFM-file contains much more lines than only my changed properties, which is the opposite of a short overview.
b) comments:
In code I can add comments to each setting wherever I think it's useful. E.g. that 'WordWrap' of a TLabel only works if 'AutoSize' is True. Or that enum 'x' for a property did not work because ... and enum 'y' did not work on Linux, and because of this I choosed enum 'z'. Or that setting a color to a TButton does work on Linux, but not on Windows (and what the alternatives are there). In sum these comments make my life much easier for future projects.
c) copy/paste for other projects:
As you did now, I often copy/paste code fragments from an older project to a newer project. Because I have all changed properties in code, I can easily copy them too - including their comments - and adapt them if needed. This makes my life much easier especially for Controls with many properties to set as e.g. a TStringGrid.
d) searching:
When I want to search, where I have changed a certain property, for me normally it's easier to search for this property with my existing search-tool for all of my sources, than to search all existing LFM-files.
Because of this I use the OI for new projects always only to set:
- the varname of a Control
- it's position (needed also for the Designer)
- it's caption (needed also for the Designer)
- and to set all Events (because they are visible in code).
Exception: for a quick test of course the OI is very comfortable and to explore / play with a completely unknown Control :-)