Public Information on Upcoming RAD Studio 10.3 – Updated!

October 30th, 2018 Posted by Embarcadero, News 1 comment

Update : Added details on the IDE UI Improvements, Android Native Controls and Z-Order and Custom managed Records

Over the last week or so Embarcadero has started publicly disclosing more information about the next major release of RAD Studio, Delphi and C++Builder, 10.3.

This is usually a pretty good sign that the release is not far away, so we thought we’d  create a single post with links to all the public information that we have, and keep it updated as more is released.

Back in August, Embarcadero updated their Public Roadmap. (Of course, something appearing on the roadmap is not a guarantee it’ll be released when they planned, but it was the best we had to go on, until recently). Here’s what they said about 10.3 at the time:

Since then, we’ve had more detailed blog posts from Embarcadero staff:

Introducing Inline Variables in the Delphi Language

I guess this comes under the “Language Enhancements…additional syntax improvements” item in the slide above, but is potentially a much bigger deal than that simple bullet point suggests. You should read Marco’s post, but in brief, this will allow you to declare a variable anywhere inside your method, not just in the var block at the beginning. Further, the variable will have true block scope, meaning the compiler will catch any references to it outside the block it is declared in (for example, the enclosing begin..end block).  They can also be declared and initialised in a single line, and also declared within a for statement.

But the big one for me is Type Inference. What this basically means is that the compiler will figure out what the type of the variable should be, based on the type of the item you assign into it. For example, if you do:

lCount will be of type Integer.

Now, let’s be clear, this is the compiler doing this. This is not done at runtime. Further, this is still strongly typed. lCount is not some dynamic type that can take all sorts of things. If on the next line you went to try and assign a string to it, you’d get the same compiler error you would have got if you’d explicitly declared it as an Integer.

Now, in this example there possibly isn’t that much value, but immediately I can think of two places I want to use this: Generics and JSON. It has always bugged me that I’ve had to be so verbose when using Generics. Now I can turn something like this:

into this:

Same end result but I haven’t had to repeat myself multiple times on what all the types are.

Now, I understand some of you won’t like this, and of course it can be abused to make code less clear. It’s totally optional, the existing way still works. But there are definitely places I’ll be using it to make my code more readable.

Directions for ARC Memory Management in Delphi

If you haven’t done much on Mobile or Linux in RAD Studio, you may not realise this, but those platforms have a different approach to memory management than Windows and Mac. The article goes into much more detail, but essentially those platforms allowed you to create objects in Delphi and not explicitly call Free. They would be reference counted much like Interfaces in Delphi. Now, just like Interfaces, there were a bunch of corner cases you need to be wary of, in addition to a runtime performance cost, and as a result, I generally found myself still writing explicit Create..Try..Finally..Free blocks on those platforms anyway. You also needed to do this in order to share code between platforms, so this change won’t break any of that code.

So the short version of Marco’s article is that ARC is being removed from the Linux compiler in 10.3, and from the mobile compilers in a future release.

Personally I think the benefits of simplification and consistency across platforms makes this worth the cost of this breaking change. However, it is a breaking change, so it’s worth changing your habits now for new code you write if you are currently not using create..try… blocks.

IDE UI Improvements in the Main Window

David Millington has just posted some details on the UI improvements made to the IDE. Some of this work started in the 10.2 timeframe, but this release brings in some of the most visible changes.

It’s easy to dismiss these changes as just decoration. I have to admit I was a little dismissive of them at first. They were nice, but I didn’t put too much value in them. However after working with the beta for awhile I realised I was enjoying it more. It was a much nicer, more consistent experience. I can’t point at any one thing that made the difference, but I definitely found myself liking it more. There’s less unnecessary clutter to distract you, more space dedicated to the working areas of the screen. A bit like cleaning your desk, it was just a more pleasant place to be afterwards.


Android Z-Order and Native Controls

If you do Android Development in RAD Studio, there’s a very good chance you’ve hit the issue that Jim writes about in this article. We’ve struck it in a customer project when using the TMapView control and wanting to float a toolbar of controls over it (kind of like the way the Search bar floats over the map in the Android Google Maps application). We got it there in the end, but it required a lot of spelunking through the way that FireMonkey interfaces with the Android windowing system and was frankly not work that we really planned on doing.

Thankfully there’s a solution out of the box now, and further, it’s not a specific TMapView solution but rather a general solution that leverages the Native Control support in Android, as well as a bunch of the refactoring to the FMX Android support that has been done over recent releases. The end result is that FireMonkey controls on Android now mesh much more nicely with the underlying platform, and things like TMapView and TWebBrowser behave how you’d expect when FMX controls are in front of them in the z-order.


Custom Managed Records

If you haven’t look at Records in Delphi in awhile, you may not have noticed that they have been getting progressively more powerful, including things like operator overloading that are not supported by classes.

This is set to continue in 10.3, with two further additions to Records:

  • The ability to have initialisation and finalisation code run whenever a record is created/removed. This is in the form of a parameterless constructor and destructor, just as you would with a class.
  • A new Assign operator that can be overloaded, to allow you to change what happens when a record is assigned to another.

I’ve grumbled about the former several times, as while it’s been possible to define a constructor on a record for awhile, you had to explicitly invoke it. The code wouldn’t run in response to a record being declared.

As Marco mentions, this simplifies implementing Smart Pointers quite dramatically. More than that, the combination of operator overloading and “proper” constructor/destructor support means I have several abandoned experiments scattered around my repository I need to revisit now that this is possible.

Stay Tuned for More

I think we’ll see more detail on the other items over the coming weeks, and we’ll update this post as we do.

I’m especially interested in seeing more around the C++17 support and the RTL performance improvements. If the recent RAD Server performance improvements are anything to go by, the bar has been set pretty high.


Tags: , ,

One comment

[…] for you, it should be a good show. 10.3 is shaping up to be a popular release. We’ve been tracking the publicly available information about 10.3 here but this webinar will be your first chance to see everything that’s planned, direct from […]

Leave a Reply