Smart pointers in Delphi
Yes, I know - I am way too late to that party.But this is yet another thing that the language itself is missing but can be done with some tricks as the posts showed. However I felt in all these...
View ArticleNever return nil? Maybe!
I admit - such headlines are getting old - at least for those that know a bit about functional programming. But for those of you not familiar with the term monad it might be new. But don't be scared...
View ArticleThe Either type for Delphi
In a previous post I talked about the Maybe type that similar to the Nullable type allows you to handle values or the state of having no value in a functional approach.Today I show you another type...
View ArticleNew dynamic array type in Spring4D 1.2
Today I want to talk about dynamic arrays. Often you might prefer them over a full blown generic list because it avoids creating an instance just to store a couple of elements (which are backed by a...
View ArticleTestInsight - unit testing like a pro
The time of teasing is finally over - today I want to show you what I have been working on over the past few weeks:TestInsight is an IDE plugin for Delphi (supporting XE and up) that will improve your...
View ArticleExtending the parallel programming library
Recently Robert Love blogged about Exception Management in the PPL (let's please stick to this abbreviation since that is what Embarcadero calls it).What I was missing though was handling exceptions in...
View ArticleType less - how to use GExperts macro templates
With all these articles and presentations about the PPL you might have seen this often. Calling TThread.Queue (or TThread.Synchronize if you are doing it wrong ;)) to execute your VCL or FMX related...
View ArticleExtending the Spring4D DI container - lifetime managers
Today we got the request to support TInterfacedPersistent in the DI container.As you may know TInterfacedPersistence does not do reference counting like TInterfacedObject does - or to be more precise...
View ArticleAnonymous method overloading
A few weeks ago I learned about Knockout.js which is a very lightweight JavaScript MVVM library. It contains of some basic features which you can read about on their home page if you are interested.I...
View ArticleGenerics, modules and typeinfo
The goodWhen working in a loosely coupled software architecture you might be using different modules: packages, dynamic link libraries and typically a host executable that loads them.If you are using a...
View ArticleI wish I had dcc32 -dontmakemycodeslow
Quick, what is wrong with this code performance wise?function TWhereIterator<T>.MoveNext: Boolean;var current: T;begin Result := False; if fState = STATE_ENUMERATOR then begin fEnumerator :=...
View ArticleHow to create an operator overload that only accepts nil
Since the introduction of Nullable types in Spring4D they had a problem: assigning null to them was cumbersome. Some time ago you could implicitly assign a Variant to them which made it possible to...
View ArticleLoop wars - measuring performance
Today on Google+ there was some off topic discussion going on and the claim was being made that for-in loops are slower than for-to loops and some benchmark was being posted to back that...
View ArticleSpring4D news and announcement
Today I would like to inform you about the recent development and some future plans of the library.As you might have seen we have been busy in various branches. The 1.2.2 branch contains many bugfixes...
View ArticleTestInsight 1.1.9.0 released
A new version of TestInsight is available for Delphi 10.1 and higher including the just released Delphi 10.4.1 - older Delphi versions can still use version 1.1.5.0.Download for 1.1.9.0 (10.1 or...
View ArticleOpen array parameters and subranges
Open array parameters in Delphi are one of the unique language constructs in Delphi. While their syntax resembles that of a dynamic array they are a different thing. In fact under the hood they consist...
View ArticleExtended Q&A to my DelphiCon session about Spring4D
Many of you have probably seen my session at DelphiCon (watch directly on Youtube) and the overall feedback has been quite positive - many thanks to you and I hope I could stir up some interest if it...
View ArticleConst parameters are an implementation detail
A parameter with a const is different from one without const in terms of a function signature. But is that actually true? Is A(x: T) really different from B(const x: T)?Disclaimer: In this article I am...
View ArticleIntroducing Delphi Uses Helper
I just wanted to share a small IDE plugin I wrote some time ago which helps adding units to your uses clause and/or navigating through code without having to rely on the faulty "Find declaration"...
View ArticleHow to hide the CodeInsight status panel
The new CodeInsight status panel added in 10.4.2 can be very distracting with its busy progressbar. Unfortunately there is no builtin mechanism to hide it but doing so is very easy.Edit: Apparently as...
View ArticleOut parameters are just bad var parameters
After talking about const parameters last time today we take a closer look at out parameters and how they differ from var parameters.I like the concept of out parameters as they clearly state that only...
View ArticleA guide on successful open source collaboration
You are sharing your source with others or you want to contribute to an open-source project? This is great!Let's talk about a few points to ensure this will be an enjoyable experience for...
View ArticleTestInsight 1.2 released
Finally! Thanks to Wagner Landgraf who implemented this feature you can now enjoy the hierarchical view of your unit tests just like you know it from the good ol' DUnit GUI.Here is how it looks in...
View ArticleIntroducing Spring.Benchmark - a port of Google benchmark
Some while ago I expressed the wish for someone to create a wrapper for the famous Google benchmark library. It is a library to write so-called microbenchmarks. Microbenchmarks can help to tune small...
View ArticleSpring4D 2.0 sneak peek - the evolution of performance
To be honest - most of the collections in Spring 1.2 are dead slow - especially on Win32. But to be fair, almost nobody complained about that so far. Now that we have some shiny tool to print some...
View Article