[fpc-pascal] FreePascal Coding style

Vinzent Hoefler JeLlyFish.software at gmx.net
Mon Jan 21 14:53:53 CET 2008


On Monday 21 January 2008 14:23, Graeme Geldenhuys wrote:
> On 21/01/2008, Vinzent Hoefler <JeLlyFish.software at gmx.net> wrote:
> > Yes, that's what I figured. But that's wrong. Only legasthenic
> > retards[1] put spaces at the inside of parentheses.
>
> Padding can be adjusted in the editor supports ET customization so
> you wouldn't see the space.

I would see it in "vi", for example. No use to me, I often have to work 
on a plain console with no fancy UI. (That's the reason why I hate 
lines longer than 79 chars.)

And hell, once I'm starting to format code for a specific editor, I 
might as well start using binaries which are interpreted and turned 
into code by an editor which supports the "binary tabbed" feature. 
(Yes, I know, I'm exaggerating now. But I've had this kind of 
discussion many times already, so I'm kind of tired of it.
Each time I proved the tool could be tricked to do something I didn't 
want it to do, he tweaked the options again (then the tool simply 
failed at a different location), or he tried to convince me to change 
my coding style to suit the tool's needs. Then I explained him that a 
tool is something that I want to work /with/, not /against/.

> > And when it reloads, everything "semantic" you put in with the tab
> > stops, got lost. Effort wasted, file needs to be reformatted.
>
> Nope, on reopening the file, formatting is exactly like it was the
> last time you edited it.

I doubt that. As far as I can see, the semantics is all in the tabs and 
if it does convert the tabs into spaces prior to saving the file, it 
will simply lose the semantics and may - at best - start guessing 
again.

> As for slowing you down. Using your code example, you would have had
> to type many spaces to align the code.

Actually, no. What kind of editors are you using? Any decent editor 
stays in the column where the previous line begins, so after the second 
line I only need to press enter and I'm right there.

> ET would only need one keystroke.

No. It wouldn't know where I want to align it. How? I'd need another 
keystroke a line before already. That means, my brain even needs to 
type ahead. No problem there, but if you want to count keystrokes...

In the end it's probably the same with or without "ET". Once I'm in the 
right column, I still only press Enter to jump to the next line 
(properly aligned already).

> And as you insert more code in line above or below, all 
> columns will shift together, whereas using spaces, you would manually
> have to realign all your columns.

Then you have the wrong editor. In my editor I can shift in or out any 
selected block as I want to.

So, all things you describe would be possible (or even faster) with 
those magic "elastic tabstops" - I am doing already without them.

And before we get carried away to much, as long as you use your single 
favourite editor, ET doesn't matter (except when you want to use 
proportional fonts for source code). Most, if not all indentation magic 
an editor does today, works with tabs, and spaces, or without them, no 
matter if those tabs are elastic, plastic or hard as a pen^Wstone.

The only difference seems to me, that without tabs the source code still 
looks the same, no matter if I look at it in "vi", "gedit", "kate", 
or "notepad". Once you start using tabs this isn't guaranteed 
anymore...


Vinzent.



More information about the fpc-pascal mailing list