Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/21/22 in all areas

  1. We are glad to announce that New Multi-platform FM Style "Mirage Light" just released: https://www.delphistyles.com/fmx/MirageLight.html New style has specific of Windows 11 and macOS Monterey UI!
  2. Uwe Raabe

    A book about Object Pascal Style Guide

    I happen to have downloaded a copy right after publishing. Here it is... Object_Pascal_Style_Guide_-_Developers_Guide.pdf
  3. In the latest daily repository available (today 02/21/2022), compiling for Linux64 there are two "probable" bugs: 1) In the file OverbyetIcsSslX509certs.pas on line 1836 the definition of the TMsCertTools class is missing. Solved like this: {$ IFDEF MSWINDOWS} FNewSslCert: = TMsCertTools.Create (self); {V8.67 was TSslCertTools} {$ ELSE} FNewSslCert: = TSSlCertTools.Create (self); {$ ENDIF} 2) In the file OverbyteIcsMailQueue.pas on line 2182 the definition of SetEndofFile is missing (in Linux it does not exist), replaced as follows: {$ IFDEF MSWINDOWS} SetEndOfFile (FHandle); // truncate file size {$ ELSE} ftruncate (FHandle, Count); // truncate file size {$ ENDIF} Inserted in the uses the unit Posix.UniStd Changes not tested yet, but the build is done. PS: I will send you a postcard as soon as possible Bye
  4. Anders Melander

    A book about Object Pascal Style Guide

    A wiki wouldn't require a coordinator once it's set up but it would still need somebody to rule in case of conflicts and since people doesn't agree on style (which is why a style guide is needed in the first place) I don't see a happy outcome of that.
  5. David Heffernan

    A book about Object Pascal Style Guide

    Collaboration requires somebody to coordinate it, which in this case would need to be the author.
  6. I was trying to improve the performance of SynEdit in handling files with super long lines (e.g. 50K characters). In doing so I came across an unexpected optimization that had a spectacular impact on performance. See this innocent looking function probably written two decades ago (fCasedLine is a PChar): function TSynCustomHighlighter.GetToken: string; var Len: Integer; begin Len := Run - fTokenPos; SetLength(Result, Len); if Len > 0 then StrLCopy(@Result[1], fCasedLine + fTokenPos, Len); end; By measuring I found that this function (called zillions of times) was a bottleneck and replaced it with: function TSynCustomHighlighter.GetToken: string; var Len: Integer; begin Len := Run - fTokenPos; SetString(Result, fCasedLine + fTokenPos, Len); end; The impact was massive. Both SetString and StrLCopy in x64 are implemented in pascal (not assembly) using Move. So initially I was puzzled. However here is the reason. Look at StrLCopy: function StrLCopy(Dest: PWideChar; const Source: PWideChar; MaxLen: Cardinal): PWideChar; var Len: Cardinal; begin Result := Dest; Len := StrLen(Source); if Len > MaxLen then Len := MaxLen; Move(Source^, Dest^, Len * SizeOf(WideChar)); Dest[Len] := #0; end; Can you see the problem? It is the call to StrLen(Source)! In my case the Source was very very long strings, the length of which was unnecessarily calculated the hard way. The lesson here is that you need to identify the bottlenecks by measuring. You may be in for surprises, sometimes pleasant ones,
  7. dummzeuch

    A book about Object Pascal Style Guide

    When posting something's like this, one has to expect feedback. And usually negative feedback more than positive. It's difficult to deal with that if you have no experience. Most people have no idea how much work is takes to write a book. (I don't either, I only write blog posts and wiki articles.)
  8. Anders Melander

    A book about Object Pascal Style Guide

    That would be a pity. I found it well written with excellent and relevant content. Unfortunately my own experience is that those that need a style guide the most are also those that are the least likely to read something like it. In my current position one of my responsibilities is to be the source code gatekeeper; I review each and every check-in for code style, bad patterns and obvious weaknesses. We need this because many of our developers are fresh out of school and inexperienced or mainly has C# experience. On top of that much of our code were written by amateurs loooong time ago and is simply horrible. On our required reading list is a very thorough style guide which I repeatedly have to refer to when people, including our lead developer, produce code that plainly demonstrates that they haven't read it. Apparently they simply haven't understood the benefits of adherence to a common code style in a large code base.
  9. aehimself

    Zeos 7.3 entered the beta phase.

    Also, you can define if LOBs should be cached on load or on access - where supported of course 🙂
×