Difference between revisions of "Talk:PChar"
From Free Pascal wiki
Jump to navigationJump to searchLine 6: | Line 6: | ||
: @[[User:Bart|Bart]]: Yeah, it’s a personal preference of me to use <syntaxhighlight lang="pascal" inline>camelCase</syntaxhighlight> in identifiers, rather than <syntaxhighlight lang="pascal" inline>CamelCase</syntaxhighlight>. Lowercase being the default, the capitalization of the first letter doesn’t improve readability. ‑‑[[User:Kai Burghardt|Kai Burghardt]] ([[User talk:Kai Burghardt|talk]]) 14:25, 3 September 2021 (CEST) | : @[[User:Bart|Bart]]: Yeah, it’s a personal preference of me to use <syntaxhighlight lang="pascal" inline>camelCase</syntaxhighlight> in identifiers, rather than <syntaxhighlight lang="pascal" inline>CamelCase</syntaxhighlight>. Lowercase being the default, the capitalization of the first letter doesn’t improve readability. ‑‑[[User:Kai Burghardt|Kai Burghardt]] ([[User talk:Kai Burghardt|talk]]) 14:25, 3 September 2021 (CEST) | ||
+ | :: Personal preferences differ. CamelCase IMO is more widely accepted than camelCase. Still I'ld prefer to follow the officila fpc source or docs for this. --[[User:Bart|Bart]] ([[User talk:Bart|talk]]) 19:38, 3 September 2021 (CEST) | ||
== Direct assignments == | == Direct assignments == |
Latest revision as of 19:38, 3 September 2021
Spelling
I noticed that throughout this page the spelling "pChar" is used.
The type PChar is defined in the system unit (rtl/inc/systemh.inc), where the spelling is "PChar".
Also: this page is called "PChar".
I would propose to change all occurences of "pChar" with "PChar" (and "pAnsiChar" with "PAnsiChar"). --Bart (talk) 12:24, 29 August 2021 (CEST)
- @Bart: Yeah, it’s a personal preference of me to use
camelCase
in identifiers, rather thanCamelCase
. Lowercase being the default, the capitalization of the first letter doesn’t improve readability. ‑‑Kai Burghardt (talk) 14:25, 3 September 2021 (CEST)
Direct assignments
The sample code is not very clear about what would make it crash. To me the phrasing suggsets that something like this should crash:
uses sysutils;
var
p: pchar;
begin
p := 'Hello';
writeln(p);
p := 'Hello World';
writeln(p);
end.
The example in User Changes 3.0 however crashes, as promised. --Bart (talk) 12:37, 29 August 2021 (CEST)
- @Bart: I dislike to show faulty code in a full-blown syntaxhighlight box, so I’ve added merely another sentence. Is that OK? ‑‑Kai Burghardt (talk) 14:25, 3 September 2021 (CEST)