Happy Birthday Delphi !
On Monday the 14th of February Delphi turns 27. The current version of Delphi is Delphi 11 Alexandria, named after the famous Alexandria library. As I’ve been developing Delphi code for some years now, I’ve also collected a library of code snippets and I would like to share the idea of creating your own library of code snippets with you.
What are code snippets?
Wikipedia defines a code snippet as a small region of re-useable source code. In Delphi these re-usable snippets can be found under Live Templates, and under several other aspects of Code Completion. My own code snippets however have a broader scope and they range from one-liners to complete design patterns and even (partial) frameworks. Sometimes a code snippet illustrates a corner case that I’m bound to forget otherwise, sometimes it’s a complete base version for creating a REST based web service or a design pattern for graceful termination of Task based multithreading.
Code snippets are really very personal and usually just useful for you and they do not need to hold up to public scrutiny. They are mostly placeholders for your knowledge, your personal library which only you know and use. For me they are also a toolbox with ready made algorithms or solutions to common coding challenges.
Maybe the idea of collecting code snippets and building your own personal Alexandria library of knowledge appeals to you as well. If so, take a look at the short video on the subject and start collecting!
Slides of this video and the source of DoubleTrouble and EZeroDivide can be downloaded here. The WinRAR archive has Delphi27 as password protection.
Don’t forget to join the Delphi27th Anniversary webinar on Monday at 17:00 CET with Jim McKeeth, Marco Cantu and David Millington.