Recent

Author Topic: 1st time with Lazarus  (Read 5124 times)

andre72

  • New Member
  • *
  • Posts: 33
1st time with Lazarus
« on: October 16, 2007, 12:44:35 pm »
I tried out Lazarus for the 1s time some two weeks ago, and successfully wrote a small application. This is to report the experience.

1. Open Lazarus and started on a new form.  

Took some time to understand that I was in Project1, then finding New Project under Project. (Quite logical, but in D7 it is under Files etc).

Delighted when the code completion feature kicked in - I had  not expected Lazarus to have it.

Had to hunt for Syntax check, found it under Tools, but no shortcut  (groan).

As I was thinking  "I'm going to miss GExperts", when I discovered the Key Mappings tab in Editor Options.

In no time I had set up GExpert-equivalent shortcuts to "Quick syntax check", "Find Next Word Occurence", "Find Previous Word Occurrence"," Comment and UnComment  code" .  Cool. This beats D7.

The 1st application form compiles, a few minor corrections.... and it runs!

-> Code completion was great.
-> Tthe key mappings facility beats D7 hands down.  
-> Visual alignment of components on a form - very nice.
-> Very rich IDE menu and menu items, no time to explore them all.
-> Change the name of a component on a form, and all the references in the unit are updated in the corresponding unit. Cool, D7 doesn't do it.
-> Loads faster than D7 (!)

I was not expecting all those features. Kudos to the developpers.


2. Further developing with Lazarus, a few rough edges:

-> Compile-Link cycle often ends with an "Internal error 200310221".
No clue as to what that can be, but the problem disappears when the compilation is repeated.

->  I cannot set the default Tab spacing:
The spacing appears to be hard coded at 8.  I usually set the tab spacing to 2, same as code indenting, and I don't use Smart Tabs.

-> You need to select a line before Commenting On or Off :
Personally I would like to be able to comment / uncomment the line on which the cursor is without selecting it first (à la GExperts).

-> Find and Replace works only on the current file.
Eventually I find a cross project search under Rename identifier and under Refactoring. However, it needs to be positioned on an identifier first. I really miss the GExperts lightning-fast grep  utility.

-> Adding an unit to the project:
If the unit sits in another directory, say /Lilb, I can open the file in the editor and add it to the project. However, I get in a "file not found" error until the path is added to the project. I'm not certain whether this is desirable or not.

-> I have a real problem understanding the Lazarus project concept.  
For example, start a new project, you get a fresh "unit1.pas" under project1.  
I ran into no end of trouble when I tried to set up an existing .pas file as the main unit and save the project . I still have not figured out what is going on at that point.


3. Exe size issue:

I had a real shock when I found the exe size to be 7'835kB. (An equivalent Delphi 7 app is 535kB)  Searched the issue in the knowledge base, and found that I was not the only one.

a.- Stripped symbols ( -Xs):         7'702kB (about 2% bettert)

b.- Display Line nb in Runtime off (-gl):  1'903 kB (better, but still 4 x D7)

c.- upx. I did not find it at once and did not feel like trying at that point.
 
d.- I also tried Smart linking. You need to check Smart linking in both Compiler Options/Code and /Linking tabs (not obvious). There a 50kB improvement,
but the exe remains 3 to 4 x D7.

-> I feel the exe size is an issue as it can put off a newcomer to Lazarus.
How about a "Build small exe" item in the Run menu that automatically sets all size optimizing procedures for that build?


4. IDE bugs?

Compilation messages, warnings are naturally off after a.-(strip symbols, -Xs) and b.- (Display line nb off, -gl). However,
 
a) The compilation messages are _not_ restored returning options a.- and b.- to their initial value. There are no more messages, even after a new build of the application, as well as after closing down and restarting Lazarus.

However, after "Files/Cleaning the Directory" the compilation messages are restored. Why? This should not happen if the Build actually recompiles all the units (my project setting is "always Build - even if nothing changed").  

b) Even after restoring the Strip Symbols and Display Line nb options to their original setting and cleaning the directory, the compiled exe stays at 7'703kB (as after a.- above) and did not return to the original 7'835kB size. Much later, I did find the exe to be 7'835kB again, but I have no idea what is was that returned the exe size to its original value.  

Turning these options off and on again should restore the exe size to its original value. Again, it looks like a  small bug to me.

 
5. Code completion disappearing trick:

Reopening Lazarus one morning, I found that Code competion stopped working altogether. In other words:

   Edit1.  (nothing happens after entering the'.' )

In the previous session I  had tried to reduce the Code Tools delay. The delay went down to the minimum, and got stuck there: I was unable to restore/increase the delay after that as it always returned to the minimum value. (IDE bug?).  I do not know whether that was the reason for Code Completion to stop working or not.

The only way I found to get Code Completion working again was to uninstall and reinstall Lazarus from scratch.


6. To conclude:

I developed a small Lazarus application, MemTest  (it tests the user's memory, not the computer's). It works fine. Except for the project files management issues, it all went rather smoothly.

I am very impressed. Many thanks and kudos to the developpers.

Regards to all - and thanks for reading this all the way down.

Andre

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
Re: 1st time with Lazarus
« Reply #1 on: October 16, 2007, 01:05:38 pm »
Long post. I am not going to respond to it all. Thanks for the feedback, especially the positive :-).

I assume you used Lazarus 0.9.22 with fpc 2.0.4.

Quote from: "andre72"

2. Further developing with Lazarus, a few rough edges:

-> Compile-Link cycle often ends with an "Internal error 200310221".
No clue as to what that can be, but the problem disappears when the compilation is repeated.

Probably a bug in fpc 2.0.4, fixed in fpc 2.2.0.
Quote

-> Find and Replace works only on the current file. ...
 I really miss the GExperts lightning-fast grep  utility.

Try Find in files.
Quote

However, after "Files/Cleaning the Directory" the compilation messages are restored. Why? This should not happen if the Build actually recompiles all the units (my project setting is "always Build - even if nothing changed").

This setting influences  if the compiler is called before running or not.

Quote
b) Even after restoring the Strip Symbols and Display Line nb options to their original setting and cleaning the directory, the compiled exe stays at 7'703kB (as after a.- above) and did not return to the original 7'835kB size. Much later, I did find the exe to be 7'835kB again, but I have no idea what is was that returned the exe size to its original value.  

Turning these options off and on again should restore the exe size to its original value. Again, it looks like a  small bug to me.

This can be explained by understanding the differences between Build and Build All. The compiler won't recompile units if it sees the source hasn't changed, so it won't include the debug info, so it won't add it to the executable again. The same goes for the compiler messages, if a unit is not recompiled, no messages are shown for it.

Quote

In the previous session I  had tried to reduce the Code Tools delay. The delay went down to the minimum, and got stuck there: I was unable to restore/increase the delay after that as it always returned to the minimum value. (IDE bug?).
Trackbar bug in 0.9.22, fixed in the development version (0.9.23).

 

TinyPortal © 2005-2018