It's happened... I have a new job, and some of the code is worth of Nick Hodges commentary:
It's happened... I have a new job, and some of the code is worth of Nick Hodges commentary:
if Data[i] in [' ', '|'] then
begin
delete(result, i, 1);
insert('|', result, i);
Exit;
end;
(bonus: this is in Delphi 2010 so I found it via the "widechar reduced to byte in set expressions" warning)
The good news is that because it's a vaguely recent Delphi I can start using OmniThreadLibrary again! We have threading, and threading issues, and a willingness to try OTL to avoid writing our own. Exciting!
if Data[i] in [' ', '|'] then
begin
delete(result, i, 1);
insert('|', result, i);
Exit;
end;
(bonus: this is in Delphi 2010 so I found it via the "widechar reduced to byte in set expressions" warning)
The good news is that because it's a vaguely recent Delphi I can start using OmniThreadLibrary again! We have threading, and threading issues, and a willingness to try OTL to avoid writing our own. Exciting!
Yeah, it is strange how some developers have an aversion for writing reusable code.
ReplyDeleteThey should start with a number and deduct a sum per line of code :)
ReplyDeleteWillo, I think that would encourage obfuscated-C style coding. Although Delphi does have a line length limit, unlike C. I prefer to use soft metrics, and keep them evolving as people start to game them (or as the defects are revealed). I vaguely recall reading evidence to the effect that static metrics will always be gamed to death, even by programmers who are trying to be good. Wish I could remember where I found it.
ReplyDelete