Demystifying pointers in Delphi

Having a general understanding of how memory and addressing works, helps you understand pointers in Delphi (and C/C++). Learning assembler also gives you that knowledge, but there are simpler ways to think about it.

A pointer is a memory location that contains the address to the actual data you want.

Think of a street with houses. Make a list of the houses and their addresses.
This is a list of pointers. Each pointer in the list leads to the actual house it refers to.

Continue reading “Demystifying pointers in Delphi”

Mssql extension adds Object Explorer and IntelliCode to VS Code

Pretty neat stuff, although the SQL command line still is a bit “raw”.  Going to explore how this combines with git versioning, because proper VCS for SQL is important!

The mssql extension for Visual Studio Code is the official SQL Server extension that supports connections to SQL Server and adds a rich editing experience for T-SQL in Visual Studio Code.

Source: Mssql extension for Visual Studio Code now has Object Explorer and IntelliCode – SQL Server Blog

Asynchronous Programming Models in C#

Pattern Description Based On Notes
Thread based By creating System .Threading .Thread instance Managed Thread Expensive, not recommended
Standard BeginXxx and EndXxx methods By calling BeginXxx method with a user callback; calling EndXxx inside that user callback Thread pool Widely used, standard, recommended, support cancellation and continuation
ThreadPool By calling ThreadPool’s static QueueUserWorkItem method Thread pool Widely used, recommended use as much as possible
Delegate By calling Delegate’s BeginInvoke and EndInvoke instance methods Thread pool Less used
Event based By subscribing to the appropriate event and calling the appropriate method Thread pool Avoid use as much as possible, not recommended
Task based By creating System .Threading .Tasks .Task instance A specified task scheduler Recommended, supports all features of a thread pool pattern, and has many other features
async method and await expression By using async and await keywords Task based pattern The new C# 5.0 asynchronous pattern

Read more in The Asynchronous Programming Models (C# 5.0 Series) at CodeProject