[fpc-pascal] Underscores in numerical literals - grouping
Vojtěch Čihák
vojtech.cihak at atlas.cz
Mon Nov 21 17:31:48 CET 2016
I guess Graeme meant to make non-monospaced font look like monospaced in Lazarus editor which currently doesn't work (it looks very ugly).
V.
______________________________________________________________
> Od: Jürgen Hestermann <juergen.hestermann at gmx.de>
> Komu: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
> Datum: 21.11.2016 17:05
> Předmět: Re: [fpc-pascal] Underscores in numerical literals - grouping
>
Am 2016-11-21 um 15:46 schrieb Graeme Geldenhuys:
> The age old rule
> of programmer source code always being in a mono-spaced font is
> ridiculous for this day and age.
>
Why?
I like monospaced fonts for code very much.
Code is not a novel or a newspaper where you read
a lot of text from top down to the end in a linear manner.
Instead, alignment is very important to make code more readable.
Monospaced fonts make it much easier to align code and
make a lot of things align 'automatically'.
I even align procedure headers like the following where all variables and
all types start at the same column
(which may not be visible in this email if you use proportional fonts ;-).
Please copy it to notepad or into Lazarus Editor in this case):
---------------------------------------------------------------------
procedure TForm1.FunctionListGetHintSize(Sender : TBaseVirtualTree;
Node : PVirtualNode;
Column : TColumnIndex;
var R : TRect);
---------------------------------------------------------------------
and I align the 'MaskFilter' variable in such a for loop:
---------------------------------------------------------------------
for i := Low (MaskFilter) to
High(MaskFilter) do
---------------------------------------------------------------------
and I like such an aligned declaration
---------------------------------------------------------------------
function FileCompareName (Datei1,Datei2 : PFileTyp) : SizeInt;
function FileCompareDate (Datei1,Datei2 : PFileTyp) : SizeInt;
function FileCompareSize (Datei1,Datei2 : PFileTyp) : SizeInt;
function DirCompareFilesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareBytesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirsInDir (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirsInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirName (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareFilesInBranch(Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareBytesInBranch(Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirsInDir (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirsInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirName (Dir1,Dir2 : PTreeTyp) : SizeInt;
---------------------------------------------------------------------
much more than a non-aligned:
---------------------------------------------------------------------
function FileCompareName (Datei1,Datei2 : PFileTyp) : SizeInt;
function FileCompareDate (Datei1,Datei2 : PFileTyp) : SizeInt;
function FileCompareSize (Datei1,Datei2 : PFileTyp) : SizeInt;
function DirCompareFilesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareBytesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirsInDir (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirsInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function DirCompareDirName (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareFilesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareBytesInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirsInDir (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirsInBranch (Dir1,Dir2 : PTreeTyp) : SizeInt;
function TreeCompareDirName (Dir1,Dir2 : PTreeTyp) : SizeInt;
---------------------------------------------------------------------
You can see imeditately that many functions have the same parameters and all result in a SizeInt.
In the non-aligned version this is harder to spot.
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal <http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20161121/12b36bac/attachment.html>
More information about the fpc-pascal
mailing list