Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-10

Verdict of Lazarus 0.9.29

38 messages · 14 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the last 3 days now.

I started with a new profile (via --pcp= parameter). Off the bat, one *major* annoyance of Lazarus IDE now is that I seem to spend more time trying to figure out how to disable all the damn "I'm trying to be clever" features of the editor! It seems the Lazarus IDE has gone totally overboard with the default settings!

I have ticked/unticked a 101 settings already, and still the damn editor tries to be clever by indenting what it thinks is good coding style, adds semi-colons where I don't want them etc.. F**ken frustrating!

How or where do I disable all these *annoying features* of the editor. I just want syntax highlighting.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

I have also concluded that the editor settings "smart tabs" should be renamed to "idiot/stupid tabs" instead, because that is exactly what it does!

| symbol denotes cursor pos, and "stupid tabs" enabled, and "auto indent" disabled and tab indentation set to 2, tabs set to "spaces".

eg:
  if Accept then
  begin|           // <--- cursor pos
    ADropAction := daCopy;
    if AMimeChoice  s then
      AMimeChoice := s;
    ShowMimeList(AMimeList);
  end;

.... I press ENTER...

  if Accept then
  begin
|           // <--- cursor pos
    ADropAction := daCopy;
    if AMimeChoice  s then
      AMimeChoice := s;
    ShowMimeList(AMimeList);
  end;

.... I then press tab once...

  if Accept then
  begin
  |           // <--- cursor pos
    ADropAction := daCopy;
    if AMimeChoice  s then
      AMimeChoice := s;
    ShowMimeList(AMimeList);
  end;

.... and then press tab once more...

  if Accept then
  begin
      |           // <--- cursor pos (jumped 4 spaces now!)
    ADropAction := daCopy;
    if AMimeChoice  s then
      AMimeChoice := s;
    ShowMimeList(AMimeList);
  end;

WTF?! And that's with "smart tabs" enabled! Hence the reason it should be renamed to "stupid tabs" instead. It better describes what it does.

PS:
There are many more such examples.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Henry Vermaak
to Graeme Geldenhuys: I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the…
Graeme Geldenhuys wrote 10 lines
Hi, I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the last 3 days now. I started with a new profile (via --pcp= parameter). Off the bat, one *major* annoyance of Lazarus IDE now is that I seem to spend more time trying to figure out how to disable all the damn "I'm trying to be clever" features of the editor! It seems the Lazarus IDE has gone totally overboard with the default settings!

Hmm, yes, same here. I don't know how you decide what the defaults should be, though, since it's such a personal thing. I personally just turn _everything_ off. At least it doesn't take long, but it would be good to have some standard profiles ranging from "I just want to be able to read my bloody code" to "omgz sparkles!!11!"

Henry

Reply by email

Graeme Geldenhuys
to Henry Vermaak

Op 2010-10-20 12:00, Henry Vermaak het geskryf:

Hmm, yes, same here.

Glad I'm not alone in this boat. I have been using the same profile for years, so it wasn't much of a problem, but starting with a new profile, I had to start fiddling with all the various editor settings (which I normally never do), trying to see what makes my editor behave normal again.

turn _everything_ off. At least it doesn't take long, but it would be good to have some standard profiles ranging from "I just want to be able to read my bloody code" to "omgz sparkles!!11!"

:-) Very good nominations for the profile names. At least that way I'll know what to avoid. Thanks Henry, that put a smile on my face.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Alexander Klenin
to Graeme Geldenhuys: I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the…
Graeme Geldenhuys wrote 12 lines
I started with a new profile (via --pcp= parameter). Off the bat, one *major* annoyance of Lazarus IDE now is that I seem to spend more time trying to figure out how to disable all the damn "I'm trying to be clever" features of the editor! It seems the Lazarus IDE has gone totally overboard with the default settings! I have ticked/unticked a 101 settings already, and still the damn editor tries to be clever by indenting what it thinks is good coding style, adds semi-colons where I don't want them etc.. F**ken frustrating! How or where do I disable all these *annoying features* of the editor. I just want syntax highlighting.

You have a point here.
I admire the work Mattias have done on auto-indenting and code completion, and think that the general direction of these features is better than that of Delphi analogs.
However, they have many bugs, like http://bugs.freepascal.org/view.php?id=17072 which seriously ruin the experience.

I myself regularly switch between "wow, neat" and
"[strong Russian expletive], my code is auto-broken again" reactions. But I believe that after bug-fixing automatic features may be left enabled by default without irritating the users.

Alexander S. Klenin

Reply by email

Martin
to Graeme Geldenhuys: I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the…
Graeme Geldenhuys wrote 17 lines
Hi, I've played with the latest snapshot of Lazarus and FPC (as release by Vincent) for the last 3 days now. I started with a new profile (via --pcp= parameter). Off the bat, one *major* annoyance of Lazarus IDE now is that I seem to spend more time trying to figure out how to disable all the damn "I'm trying to be clever" features of the editor! It seems the Lazarus IDE has gone totally overboard with the default settings! I have ticked/unticked a 101 settings already, and still the damn editor tries to be clever by indenting what it thinks is good coding style, adds semi-colons where I don't want them etc.. F**ken frustrating! How or where do I disable all these *annoying features* of the editor. I just want syntax highlighting.

Well, yes there is a bit of a hichup => the IDE has 2 auto indents...

Editor=> general:
the old auto indent. indents exactly as much as the previous line was indented

the new one:
Codetools -> general
overrides the above, if switched on, and does the "mind of it's own" auto indent

yeah, I know: who is expecting it to be in the codetool section, especially if another auto-indent is n another page? (there is a link , you can link, on the editor page, but that's no excuse...)

---

And you probably also want to go to:
Editor => "automatic features"
and look at "add close statement for pascal blocks"

that's all the "end" that get inserted....

And yes that page "automatic features" is another place, where no one ever would expect anything.... (half of it is display related, and should be on a page nested into display) => for the rest: a good name is needed.... (maybe the hints can even get there own page...)

Reply by email

Andrew Brunner
to Graeme Geldenhuys: Op 2010-10-20 14:40, Martin het geskryf: Ah, finaly I killed the "indent on paste"…

Actually, I am often pleased when I copy/cut and past a block of text from one area to another only to find that the Editor knew what I was trying to do. I've left all the defaults the same. But I install Ubuntu often. One suggestion may be to delete your Lazarus profile information in your home directory. This will reset everything to the latest and greatest as defaults and ensure that any settings you change will actually be respected...

Reply by email

Martin
to Graeme Geldenhuys: I have also concluded that the editor settings "smart tabs" should be renamed to…
Graeme Geldenhuys wrote 13 lines
I have also concluded that the editor settings "smart tabs" should be renamed to "idiot/stupid tabs" instead, because that is exactly what it does! | symbol denotes cursor pos, and "stupid tabs" enabled, and "auto indent" disabled and tab indentation set to 2, tabs set to "spaces". eg: if Accept then begin| //<--- cursor pos .... I press ENTER...

no auto-indent => so you are on the first column => so far nothing wrong? (you have not used the tab key, so you should not expect any action from it)

I updated the help:
http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options#Smart_tabs Hope it is more understandable now.

   if Accept then
   begin
|
1 2    3    4   5

1 begin of line
2 first word "begin"
3 end of line
4 next word, but 2 lines above (first line long enough) 5 end of line but 2 lines above

Reply by email

Graeme Geldenhuys
to Martin: Well, yes there is a bit of a hichup => the IDE has 2 auto indents... Editor=> general:…

Op 2010-10-20 14:40, Martin het geskryf:

Show quoted text 5 lines
the new one: Codetools -> general overrides the above, if switched on, and does the "mind of it's own" auto indent

Ah, finaly I killed the "indent on paste" feature too. It always got it wrong.

yeah, I know: who is expecting it to be in the codetool section, especially if another auto-indent is n another page? (there is a link , you can link, on the editor page, but that's no excuse...)

You are right, that doesn't work to well.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Andrew Brunner
to Martin: no auto-indent => so you are on the first column => so far nothing wrong? (you have not…
?if Accept then ?begin | 1 2 ? ?3 ? ?4 ? 5

Actually, I rarely break my If statements across more than one line save to accommodate large logic statements for code readability.

if (condition1=condition2) or (conditionx=conditiony) then begin
  // code here
end else begin
  // more code here
end;

Since I did this, I find that switching back and forth from Java/C#/Pascal/Javascript makes for quick code reading. Otherwise it's way too difficult. I realize this is just my personal preferences but I am also convinced after using this technique, most would be using it as well.

Reply by email

Graeme Geldenhuys
to Andrew Brunner: Actually, I am often pleased when I copy/cut and past a block of text from one area to…

Op 2010-10-20 14:51, Andrew Brunner het geskryf:

Ubuntu often. One suggestion may be to delete your Lazarus profile information in your home directory. This will reset everything to the latest and greatest as defaults and ensure that any settings you change will actually be respected...

This is where the whole problem started. I've been using my existing profile for probably 4 years now - it works perfectly. With Vincent's snapshot release, I thought I would try a clean-room test. Everything set to defaults, using a brand new profile (hence my reference to using the --pcp= parameter, so I don't loose my old profile, or let it interfere with the default settings.). So the issues are caused by the stupid default settings. The IDE trying to be too clever, but fails misserably. This results in the developer having to waist lots of time trying to disable these annoying "features".

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Andrew Brunner
to Graeme Geldenhuys
Graeme Geldenhuys wrote
The IDE trying to be too clever, but fails misserably. This results in the developer having to waist lots of time trying to disable these annoying "features".

Hmm... When using lazarus from /trunk you should be more open to discussing/resolving/reporting issues with respect to leaps in features such as smart space/tabs.

When things don't go your way. Sit back, re-produce the steps, and say something like this is what I expect it to do. Keep it factual if not positive because the person who did/has the responsibility of fixing this issue should be able to do so without feeling personally put-down.

But I do agree that this is frustrating. I remember when Lazarus used to crash when laying out my forms with tons of components only to be missing them when I reopen the editor. I also recall a time when Delphi did the very same things.

Reply by email

Graeme Geldenhuys
to Martin: no auto-indent => so you are on the first column => so far nothing wrong? (you have not…

Op 2010-10-20 14:52, Martin het geskryf:

Show quoted text 15 lines
I updated the help: http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options#Smart_tabs Hope it is more understandable now. if Accept then begin | 1 2 3 4 5 1 begin of line 2 first word "begin" 3 end of line 4 next word, but 2 lines above (first line long enough) 5 end of line but 2 lines above

Thanks for the info on how it works, but I'll definitely keep that setting disabled. I want tabs to have a set indentation of two spaces.

PS:
I have never seen code indented the way that "smart tab" algorithm works, so what's the point of it then.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys: I have also concluded that the editor settings "smart tabs" should be renamed to…

Zitat von Graeme Geldenhuys :

Show quoted text 6 lines
I have also concluded that the editor settings "smart tabs" should be renamed to "idiot/stupid tabs" instead, because that is exactly what it does! | symbol denotes cursor pos, and "stupid tabs" enabled, and "auto indent" disabled and tab indentation set to 2, tabs set to "spaces".

Have you seen the link on the editor options to the codetools option?

Show quoted text 20 lines
eg: if Accept then begin| // <--- cursor pos ADropAction := daCopy; if AMimeChoice s then AMimeChoice := s; ShowMimeList(AMimeList); end; .... I press ENTER... if Accept then begin | // <--- cursor pos ADropAction := daCopy; if AMimeChoice s then AMimeChoice := s; ShowMimeList(AMimeList); end;

Please report this bug.
Probably the tool spotted some unclosed structure in front or some misindented lines.
I'm currently busy working on another feature you et al requested.

Show quoted text 21 lines
.... I then press tab once... if Accept then begin | // <--- cursor pos ADropAction := daCopy; if AMimeChoice s then AMimeChoice := s; ShowMimeList(AMimeList); end; .... and then press tab once more... if Accept then begin | // <--- cursor pos (jumped 4 spaces now!) ADropAction := daCopy; if AMimeChoice s then AMimeChoice := s; ShowMimeList(AMimeList); end;

If this is a bug depends on your editor settings. Probably Martin knows.

WTF?!

+1

Show quoted text 6 lines
And that's with "smart tabs" enabled! Hence the reason it should be renamed to "stupid tabs" instead. It better describes what it does. PS: There are many more such examples.

Please give them.

Mattias

Reply by email

Graeme Geldenhuys
to Andrew Brunner: On Wed, Oct 20, 2010 at 8:08 AM, Graeme Geldenhuys Hmm... When using lazarus from /trunk…

Op 2010-10-20 15:11, Andrew Brunner het geskryf:

Hmm... When using lazarus from /trunk you should be more open to discussing/resolving/reporting issues with respect to leaps in features such as smart space/tabs.

Do a Mantis search, I think I report more than enough bugs already.

The purpose of FPC 2.4.2rc1 and the Lazarus snapshot release Vincent made is for the purpose of testing. That's exactly what I have done. Lazarus seems to time it's releases with FPC, so this message thread was just one of many feedbacks on that "what is to become the next Lazarus release".

I'm simply pointing out that the default settings are not ideal, and actually cause more harm than good.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Martin
to Mattias Gärtner: Zitat von Graeme Geldenhuys : Have you seen the link on the editor options to the…
Mattias G?rtner wrote 11 lines
Zitat von Graeme Geldenhuys : > I have also concluded that the editor settings "smart tabs" should be > renamed to "idiot/stupid tabs" instead, because that is exactly what > it does! > > > | symbol denotes cursor pos, and "stupid tabs" enabled, and "auto > indent" > disabled and tab indentation set to 2, tabs set to "spaces".

....

Show quoted text 5 lines
Please report this bug. Probably the tool spotted some unclosed structure in front or some misindented lines. I'm currently busy working on another feature you et al requested.

I believe he had all auto indent (including code tools) off? Graeme?

So he could figure out "smart tabs" on their own

Reply by email

Vincent Snijders
to Graeme Geldenhuys: Op 2010-10-20 15:11, Andrew Brunner het geskryf: Do a Mantis search, I think I report…

2010/10/20 Graeme Geldenhuys :

Show quoted text 10 lines
Op 2010-10-20 15:11, Andrew Brunner het geskryf: > > Hmm... When using lazarus from /trunk you should be more open to > discussing/resolving/reporting issues with respect to leaps in > features such as smart space/tabs. Do a Mantis search, I think I report more than enough bugs already. The purpose of FPC 2.4.2rc1 and the Lazarus snapshot release Vincent made is for the purpose of testing.

More specifically, to test fpc 2.4.2rc1 is good enough to be released as fpc 2.4.2 and good enough to base a future Lazarus release upon.

You discovered some issues with the compiler / tools (fpcres?), which I good not reproduce yet.

That's exactly what I have done.

Thanks for the feedback. I tried to filter out the useful parts.

Vincent

Reply by email

zeljko
to Martin: Well, yes there is a bit of a hichup => the IDE has 2 auto indents... Editor=> general:…
And yes that page "automatic features" is another place, where no one ever would expect anything.... (half of it is display related, and should be on a page nested into display) => for the rest: a good name is needed.... (maybe the hints can even get there own page...)

At least all those options checkboxes, tedits etc..should have hint + showHint filled up.

zeljko

Reply by email

Mattias Gärtner
to Martin: Well, yes there is a bit of a hichup => the IDE has 2 auto indents... Editor=> general:…

Zitat von Martin :

Show quoted text 46 lines
On 20/10/2010 10:39, Graeme Geldenhuys wrote: > Hi, > > I've played with the latest snapshot of Lazarus and FPC (as release by > Vincent) for the last 3 days now. > > I started with a new profile (via --pcp= parameter). Off the bat, one > *major* annoyance of Lazarus IDE now is that I seem to spend more time > trying to figure out how to disable all the damn "I'm trying to be clever" > features of the editor! It seems the Lazarus IDE has gone totally overboard > with the default settings! > > I have ticked/unticked a 101 settings already, and still the damn editor > tries to be clever by indenting what it thinks is good coding style, adds > semi-colons where I don't want them etc.. F**ken frustrating! > > How or where do I disable all these *annoying features* of the editor. I > just want syntax highlighting. Well, yes there is a bit of a hichup => the IDE has 2 auto indents... Editor=> general: the old auto indent. indents exactly as much as the previous line was indented the new one: Codetools -> general overrides the above, if switched on, and does the "mind of it's own" auto indent yeah, I know: who is expecting it to be in the codetool section, especially if another auto-indent is n another page? (there is a link , you can link, on the editor page, but that's no excuse...) --- And you probably also want to go to: Editor => "automatic features" and look at "add close statement for pascal blocks" that's all the "end" that get inserted.... And yes that page "automatic features" is another place, where no one ever would expect anything.... (half of it is display related, and should be on a page nested into display) => for the rest: a good name is needed.... (maybe the hints can even get there own page...)

Yes. OTOH codetools are only for pascal. If we move the codetools options to the editor options, it must be made clear that these are only for pascal.
I'm not sure how to do that in an intuitive way.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gärtner: Zitat von Graeme Geldenhuys : Have you seen the link on the editor options to the…

Op 2010-10-20 15:28, Mattias G?rtner het geskryf:

Have you seen the link on the editor options to the codetools option?

Yes, but that seems wrong. Why two tools to do indentation, and if both enabled gives undefined behaviour. It should always be one or the other, and preferably on the same Text Editor Settings dialog.

Please report this bug. Probably the tool spotted some unclosed structure in front or some misindented lines. I'm currently busy working on another feature you et al requested.

Martin explained the indentation algorithm for "smart tabs", so apparently it is not a bug, just very weird indentation style. I think at the time I already disabled the CodeTools indentation and only had smart tabs enabled....I made too many changes to know for sure, but at least now my editor is finally behaving as I prefer (after disabling most/all "auto" features).

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Mattias Gärtner
to Graeme Geldenhuys: Op 2010-10-20 14:51, Andrew Brunner het geskryf: This is where the whole problem started.…

Zitat von Graeme Geldenhuys :

Show quoted text 16 lines
Op 2010-10-20 14:51, Andrew Brunner het geskryf: > Ubuntu often. One suggestion may be to delete your Lazarus profile > information in your home directory. This will reset everything to the > latest and greatest as defaults and ensure that any settings you > change will actually be respected... This is where the whole problem started. I've been using my existing profile for probably 4 years now - it works perfectly. With Vincent's snapshot release, I thought I would try a clean-room test. Everything set to defaults, using a brand new profile (hence my reference to using the --pcp= parameter, so I don't loose my old profile, or let it interfere with the default settings.). So the issues are caused by the stupid default settings. The IDE trying to be too clever, but fails misserably. This results in the developer having to waist lots of time trying to disable these annoying "features".

I'm sure that adding a button to choose a set of options would solve your problem, but I seriously doubt that we can agree on 'common' predefined sets.
For example should 'no automatism - plain editor' deactivate code templates or not.

Feel free to begin a thread to discuss such sets.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gärtner: Zitat von Martin : Yes. OTOH codetools are only for pascal. If we move the codetools…

Op 2010-10-20 15:49, Mattias G?rtner het geskryf:

Yes. OTOH codetools are only for pascal. If we move the codetools options to the editor options, it must be made clear that these are only for pascal.

I didn't know that, but I see your point.

I'm not sure how to do that in an intuitive way.

I'm afraid I have no idea either. Where are all the "fancy UI design experts" when you need them? :-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Mattias Gärtner

Zitat von Andrew Brunner :

Show quoted text 5 lines
[...] But I do agree that this is frustrating. I remember when Lazarus used to crash when laying out my forms with tons of components only to be missing them when I reopen the editor. I also recall a time when Delphi did the very same things.

Maybe a form loaded with errors should be marked as broken and the IDE should ask before saving it.
Any better idea?

Mattias

Reply by email

Mattias Gärtner
to Graeme Geldenhuys: Op 2010-10-20 15:28, Mattias G?rtner het geskryf: Yes, but that seems wrong. Why two…

Zitat von Graeme Geldenhuys :

Show quoted text 7 lines
Op 2010-10-20 15:28, Mattias G?rtner het geskryf: > > Have you seen the link on the editor options to the codetools option? Yes, but that seems wrong. Why two tools to do indentation, and if both enabled gives undefined behaviour. It should always be one or the other, and preferably on the same Text Editor Settings dialog.

The codetools is used only on pressing Return and on Paste (no replace) and only for pascal.
The codetools auto indenter copies the indentation from the surrounding code (including the example file,
~/.lazarus/laz_indentation.pas). There are some open issues.

Mattias

Reply by email

Martin
to Mattias Gärtner: Zitat von Martin : Yes. OTOH codetools are only for pascal. If we move the codetools…
Mattias G?rtner wrote 6 lines
Yes. OTOH codetools are only for pascal. If we move the codetools options to the editor options, it must be made clear that these are only for pascal. I'm not sure how to do that in an intuitive way.

I still think they need a more prominent place in the editor section... (or maybe ion both location)

There are 2 feature from codetool people do not find on a regular (imho) base:
- automatic end
- smart codetool indent

- smart codetool indent, maybe could have a checkbox on the editor/general page: "codetool/pascal indent" and the link. The checkbox would be a duplicate of what's on the codetool page. the fine-tuning can stay on codetools.

- automatic end, currently is hidden between configuring the "hint" behaviour on the "automatic feature" page.
I am not sure where it would be best placed. IMHO in codetools...

- And if I find time, or someone wants to supply a patch: I believe the "automatic feature" should be removed completely. The contents redistributed as follows
-- word-under-caret and bracket-match => Editor / Display / "Highlight Matches" (or similar name)
-- the entries about editor-hints / debug-hints => either their own page (maybe codetools) or => editor / misc
-- Auto-remove-empty-methods / add-close-statements-for-pascal => codetools

Reply by email

waldo kitty
to Andrew Brunner: Actually, I rarely break my If statements across more than one line save to accommodate…
Andrew Brunner wrote 19 lines
> if Accept then > begin > | > 1 2 3 4 5 Actually, I rarely break my If statements across more than one line save to accommodate large logic statements for code readability. if (condition1=condition2) or (conditionx=conditiony) then begin // code here end else begin // more code here end; Since I did this, I find that switching back and forth from Java/C#/Pascal/Javascript makes for quick code reading. Otherwise it's way too difficult. I realize this is just my personal preferences but I am also convinced after using this technique, most would be using it as well.

just to toss my two cents into the ring... the above is not for me... i'm very old-school... begin and end get their own line in my world...

Reply by email

waldo kitty
to Graeme Geldenhuys: Op 2010-10-20 14:52, Martin het geskryf: Thanks for the info on how it works, but I'll…
Graeme Geldenhuys wrote 20 lines
Op 2010-10-20 14:52, Martin het geskryf: > I updated the help: > http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options#Smart_tabs > Hope it is more understandable now. > > if Accept then > begin > | > 1 2 3 4 5 > > > 1 begin of line > 2 first word "begin" > 3 end of line > 4 next word, but 2 lines above (first line long enough) > 5 end of line but 2 lines above Thanks for the info on how it works, but I'll definitely keep that setting disabled. I want tabs to have a set indentation of two spaces.

+1 ;)

but i guess this is also why my space bar gets worn out much faster than my tab key as i have a huge muscle memory function that automatically hits the space bar twice when necessary :P

PS: I have never seen code indented the way that "smart tab" algorithm works, so what's the point of it then.

it is all martian to me... just like cell phones are /phones/... i just use spaces and get really frustrated with those things that use tabs because tabs always get different "space counts" depending on whatever... spaces are spaces are spaces and no one can dispute or complain about readability or formatting when using spaces for indention all the time ;)

/me ducks back under his old-school rock :mrgreen:

Reply by email

Graeme Geldenhuys
to waldo kitty: just to toss my two cents into the ring... the above is not for me... i'm very…

Op 2010-10-21 00:21, waldo kitty het geskryf:

just to toss my two cents into the ring... the above is not for me... i'm very old-school... begin and end get their own line in my world...

+1
I use Borland Delphi coding style. Always have, always will.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

A.J. Venter
to Andrew Brunner: Actually, I rarely break my If statements across more than one line save to accommodate…
Show quoted text 6 lines
Since I did this, I find that switching back and forth from Java/C#/Pascal/Javascript makes for quick code reading. ?Otherwise it's way too difficult. ?I realize this is just my personal preferences but I am also convinced after using this technique, most would be using it as well.

I've been using exactly the method you describe for some 15-odd years, I started doing that back in turbopascal 4 days and never changed - I like it that way and it makes for sensible, readable code, which coincidentally is the same structure that php, java and C coders would normally default to.

A.J.
-
A.J. Venter
Founder and lead developer, Kongoni GNU/Linux
www.kongoni.co.za
www.silentcoder.co.za - Blog

Reply by email

Marco van de Voort
to Andrew Brunner: Actually, I rarely break my If statements across more than one line save to accommodate…
Andrew Brunner wrote 13 lines
> ?if Accept then > ?begin > | > 1 2 ? ?3 ? ?4 ? 5 Actually, I rarely break my If statements across more than one line save to accommodate large logic statements for code readability. if (condition1=condition2) or (conditionx=conditiony) then begin // code here end else begin // more code here end;

I never got used to having begin not on a newline. Even despite having used modula2 for use (but M2 has no single line blocks to disambiguate).

Moreover, it rarely pays to use a convention different from the norm. (and the norm on Delphi is begin on a newline afaik)

preferences but I am also convinced after using this technique, most would be using it as well.

I actually started like that because it matched the M2 style I'm used to better, but gave it up later. Unworkable.

Reply by email

A.J. Venter
to Marco van de Voort
Show quoted text 11 lines
> Actually, I rarely break my If statements across more than one line > save to accommodate large logic statements for code readability. > > if (condition1=condition2) or (conditionx=conditiony) then begin > ? // code here > end else begin > ? // more code here > end; I never got used to having begin not on a newline. Even despite having used modula2 for use (but M2 has no single line blocks to disambiguate).

Actually I missed that bit, I agree - it's better to put begin and end statements on their own lines.
It makes blocks just that much easier to differentiate.

In C there seems to be two popular approaches, one putting the opening { on the same line (this seems to be by far more popular one in languages like python) and the other putting it on it's own line as we normally do with begin.
This is the GNU prescribed style I believe.

Either way I think it's slightly less important when you have a single-character opening statement, when you have a whole word, it changes things a bit.

Still - I would rather have OP which lets me define an indentation style and then sometimes break it when it makes sense, than python which dictates one to me in absolute terms by removing the block statements entirely and making indent = block.

A.J. Venter Founder and lead developer, Kongoni GNU/Linux www.kongoni.co.za www.silentcoder.co.za - Blog

Reply by email

Martin
to Marco van de Voort: I never got used to having begin not on a newline. Even despite having used modula2 for…
Marco van de Voort wrote 14 lines
On Wed, Oct 20, 2010 at 07:59:48AM -0500, Andrew Brunner wrote: >> ?if Accept then >> ?begin >> | >> 1 2 ? ?3 ? ?4 ? 5 > Actually, I rarely break my If statements across more than one line > save to accommodate large logic statements for code readability. > > if (condition1=condition2) or (conditionx=conditiony) then begin > // code here > end else begin > // more code here > end;

.... many people about coding style of "if begin" in 1 or 2 lines ....

It is amazing:
A email explaining how a certain tab-mode works, and which uses some example code that happen to contain a "if .. begin"

And you get a complete re-issue of the coding style discussion... Not only unrelated to the original post, but even better: Everyone still quotes the "1 2 ? ?3 ? ?4 ? 5" indicating the locations of the tabs .... :)

Next time i explain tabs I do it like this

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
1 2 3 4 5 6 7 8 9 10

And hopefully someone is going to tell me about how to layout that in print.

SCNR ;>

Reply by email

Martin
to Graeme Geldenhuys: Op 2010-10-20 14:52, Martin het geskryf: Thanks for the info on how it works, but I'll…
Graeme Geldenhuys wrote 12 lines
Op 2010-10-20 14:52, Martin het geskryf: > I updated the help: > http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options#Smart_tabs > Hope it is more understandable now. > > if Accept then > begin > | > 1 2 3 4 5 PS: I have never seen code indented the way that "smart tab" algorithm works, so what's the point of it then.

Well I didn't invent it, so I don't know it's original intend.

But tabs (or rather the tab key, producing a sequence of spaces) are not only used for indent (as in indent at the start of line)

You could use this to align comments at the end of line (in most case you probably have to press more than once, but less often than space... Especially if the editor doesn't have flexible tabs...

Reply by email

Sven Barth
to A.J. Venter: Actually I missed that bit, I agree - it's better to put begin and end statements on…
A.J. Venter wrote 5 lines
In C there seems to be two popular approaches, one putting the opening { on the same line (this seems to be by far more popular one in languages like python) and the other putting it on it's own line as we normally do with begin. This is the GNU prescribed style I believe.

Ehm... Python uses neither "{...}" nor "begin ... end", but indentation itself to declare blocks (which is also an interesting approach).

Regards,
Sven

Reply by email

Alexander Klenin
to Martin: .... many people about coding style of "if begin" in 1 or 2 lines .... It is amazing: A…
Martin wrote 9 lines
Next time i explain tabs I do it like this Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 1 ?2 ? ? ?3 ?4 ? ? ?5 ? ? 6 ? ? ?7 ? ? ?8 ? ? ? ? ? 9 ? ?10 And hopefully someone is going to tell me about how to layout that in print.

Maybe the problem is in the option name "smart tabs" does not convey this "Tab to the word boundary" or something like that.

Alexander S. Klenin

Reply by email

Graeme Geldenhuys
to Martin: Well I didn't invent it, so I don't know it's original intend. But tabs (or rather the…

Op 2010-10-21 19:34, Martin het geskryf:

Well I didn't invent it, so I don't know it's original intend. But tabs (or rather the tab key, producing a sequence of spaces) are not only used for indent (as in indent at the start of line)

This brings me to my next question (see the fpc-devel mailing list too). If my source code only contains tab( #09) characters, and not spaces, it results in a much smaller file size. Does that also translate to FPC being able to parse that source code faster (less characters to parse), and does that also translate to the SynEdit component working faster (again, less characters to process)?

Some form of speed test to compare the difference should be interesting. :-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net:8080/fpgui/

Reply by email

Juha Manninen gmail
to Martin: no auto-indent => so you are on the first column => so far nothing wrong? (you have not…
Martin wrote 11 lines
if Accept then begin 1 2 3 4 5 1 begin of line 2 first word "begin" 3 end of line 4 next word, but 2 lines above (first line long enough) 5 end of line but 2 lines above

I get the feeling of stupid tabs, too, sometimes.
The most obvious location is missing. That is between "2" and "3", the indented code after "begin". Usually the codetools-based autoindent takes care of it when you press Enter, but not always.
To make the tab smarted it could ask for info from codetools about good indentation spots.

Another improvement would be to inspect the surrounding code instead of just preceding code. For example if I want to align comments:

  s1 := MyFunc1();                 // Comment at the column I want it to be.
  s2 := MyFunc2();|  <-- cursor

Now the tab is smart, good.
But if I have:

  s1 := MyFunc1();|  <-- cursor
  s2 := MyFunc2();                 // Comment at the column I want it to be.

The tab became stupid again.

This smart tab feature could be integrated with codetools indentation feature somehow.
There is an issue of the GUI settings being on different pages. Maybe it indicates that the design is not perfect either.

Juha

Reply by email