Earlier this week I presented a webinar with fellow Embarcadero MVP and TMS Evangelist Dr. Holger Flick about the superb TMS Web Core product.
You can view the official replay here:
TMS Web Core allows you to create fully interactive web pages using Embarcadero Delphi as the ‘back end’ programming language. When you hit the compile button instead of a traditional Windows executable being created you get instead pure HTML pages with CSS ready to copy over to a plain old regular web server – no further requirements beyond that.
Web Core really highlights how easy and yet powerful the Delphi language is for writing programs. The ‘strong typing‘ is part of the secret sauce and the “R” in RAD truly demonstrates itself to mean “rapid”. Using Delphi you can frequently and repeatedly produce robust, performant and richly functional applications with embarrassingly minimal effort. Seriously, it’s sometimes a little too easy and you think to yourself, “did I miss something?” – but no, it doesn’t have to be hard to create applications – and TMS Web Core extends that understated power to creating interactive web sites using Delphi.
I can’t even begin to tell you how game- changing TMS Web Core is for Delphi programmers. There are creditable alternatives such as the venerable IntraWeb, but TMS Web Core feels a little more ‘right’, to me, and genuinely the experience is one of creating a regular Delphi application which just happens to pop out as a set of HTML pages. No mess, no fuss and easy to put up on to any web host on any hosting service of your choice.
I’m going to stream some more about this soon as I think the way I would present the product is slightly different to Holger – not better or worse, just an alternative angle!
Holger has written several excellent books on using Web Core and Delphi in general. He’s an excellent developer with broad experience, even working for a time for Borland. I recommend taking a look at the books by clicking here.
I thought, given my past as a published poet, that I would at least use a more rare word in a title for a Delphi blog post I was prompted to produce and, with that, add some pseudo-pentameter look and feel. In short, having a little lyrical laugh, to show that density of prose and a divers or archaic choice of words does not always serve to promote clarity. To say more sometimes is to say less and by saying less I mean this to say you, who I choose to hope to help by writing will gain more when I write the right thing succinctly, without literary ornamentation and, I believe, even more is to be gained by you if I show you things, by streaming, either live or re-recorded so you can, should you elect, pause, rewind, stop, skip through any boring bits and get value from it in and of itself, as I, in my mind, perhaps in a folly of imagination, like to think you do.
Those proceeding 170 words are a bit of a word spaghetti aren’t they? Here’s the thing (to be said in your mind like Adrian Monk) – I always, when I write on this blog and when I stream, strive to be clear and approachable. Not only that, I will try and be as honest as I can and show you code and techniques that are not fancy for the sake of being fancy – I want to show things that maybe you don’t know how to do (otherwise, what’s the point?) and will really help you, generally because they helped me.
With this in mind, August is going to be a little bit of a tsunami of me taking part in some streams. Texas is way too hot to go outside in August anyway so I may as well spend an extra amount of time scrunched over a clicky keyboard and putting my reputation at the mercy of several webinars. Ah, what could possibly go wrong? 😋
Plus, it appears, that this brutal pandemic seems to be not quite ready to ride off into the sunset. Social distancing and the temporary interruption to what we’ve all previously thought is normal: going out, having a social life; even the simple pleasure of eating is curtailed – so we have a little more time on our hands to learn new things, myself included.
I really think Delphi is my super-power. If that sounds like a sales line, it’s not. If you watched the recent Fireside Chat session I had with Jim McKeeth you’ll hear me go into a lot more detail about what it is I do for a ‘day job’, my background and history as well as a few of my thoughts on Delphi and code in general. It’s that faith in the ability of Delphi to produce ROCK SOLID stable applications in a very short space of time using a language which has an elegance to it which totally clicks for me and has the power to Get Stuff Done that enthuses me to write things here and to take part in the webinars and so on.
So, all that said and done, what have I got planned for August?
On Wednesday 19th August…
How to give your apps the REALLY COOL Windows 10 Fluent UI look and feel with Delphi
(Note that I originally had planned this for 5th August but that proved to be too short notice).
Fluent UI is the new hotness. If you have a recent version of Windows 10 then you’ve surely noticed it by now. Buttons with very cool grad fills which follow the mouse as it hovers over them, icons which are either scaled vector graphics (SVGs) or are drawn from the epic Font Awesome set, plus a whole raft of other subtle and not so subtle gizmos like borders which add affordance to windows to help you spot which ones are active or inactive.
And I haven’t even mentioned the ‘acrylic’ look and feel where portions of your screen are semi-transparent and allow a portion of the background to show through, slightly blurred. It’s cooler than ice cold.
Fluent UI is, without doubt one of the best things to happen to Microsoft Windows in the past few years – and I’m going to show you how to do it, in Delphi. There will be a full blog post backing it up along with some sample code on GitHub.
Speaking of GitHub…
On Wednesday 12th August
Using Git source code control with Delphi and RAD Studio – all the reasons WHY and EVERYTHING you need to know
Over the past few months we MVPs have been canoodling together in our secret chat rooms and darkened corners of the web and we’ve come to realize something: there are a heck of a lot of people out there who either don’t use source code control or use it but have this horrible nagging doubt that they’re only using a tiny fraction of its capabilities.
It’s a common theme for people to say “I back everything up to an external hard drive”.
I live in Tornado Alley in Texas. In fact I’ve always lived in the most active tornado zones ever since I emigrated to the USA. Mother Nature can go from blazing hot sunny day to house destroying poop your pants F5 tornado in a very few short minutes here. That gives you a whole new perspective on whether or not your code is really backed up properly. Git and GitHub, GitLab, BitBucket or one of the many and multiplying git hosting services can make this sort of life-changing destruction less… terrifying… and, if you charge for your services, less likely for you to be sued.
But that said, the main point about Git is sharing code with others, controlling the chaos that occurs when you try that – there’s a reason why nearly all verbs to do with source code collaboration are aggressive: blame, force, commit (like a crime), pull (why not sync or combine?)
Rad Studio has all the things you need in it to use Git (and SVN but I’m going to focus on Git). I’m going to show you every single aspect of Git from the why to how to when. I’ll show you some very cool tools which will make the whole process a lot less painless. Git is notorious for being a little reticent to mere mortal programmers like you and I. I’m going to pull back the kimono a little in this webinar. Even Marco Cantu (who apart from being a Delphi legend is also a certified genius) said he was looking forward to the Git webinar. No pressure, Ian, no pressure! 😁
and finally, Esther, we come to a webinar which we’re doing because so many people asked us to at a previous webinar…
On Wednesday 26th August
I’ll be co-hosting with TMS Product Evangelist Dr Holger Flick a webinar titled :-
Creating fully interactive web applications using Rad Studio, Delphi and TMS Web Core
If you’re a Delphi developer there are more than a few different ways of producing web apps. I’ve personally used the excellent Intraweb. I’ve also used Web Broker and Datasnap. However the thing which really clicked for me when I first came across it was Web Core from TMS Software.
Holger will whizz through what TMS Web Core can do and show some excellent, easy to digest demos. He’s also got a few books available which will give you a leg up too should you need it.
All of these webinars will start at 11:00am CST, 4pm UTC, 5pm BST. You can check the times in your time zone via Embarcadero. I’ll update this blog post with the links when I have them.
I intend to write some fairly extensive blog posts to accompany the webinars. If you have any other ideas for Delphi-related subjects we could cover – let me know.
August is going to be an interesting time. Wait until you find out what’s planned for September!
The local repo is tracked in the same folder it ‘lives’ in using a hidden sub-folder and some ‘magic’ files.
Everything else is just your regular Delphi source code, images and project resources.
Once you have created a repo in a project folder any changes you make in the repo folder are tracked by Git from then on.
Files that existed when you created the repo
New files created
This means everything including things you might not want to track – but you can tell Git which files to ignore, for example the _history folder contents and files ending in .~pas and .~dfm
Telling Rad Studio your Git settings
In the Rad Studio IDE select tools and then options from the menu.
From that menu select version control and then Git.
Remember the path I told you to make a note of when you installed Git For Windows? This is where you need it 😉
The user name and email are the ones you use with your Git hosting company and/or typed in during the Git for Windows installation.
Using Git – opening an existing repository
We are going to ‘clone’ an existing repository. In other words we’re going to copy it to our local machine.
So, first, select File, Open From Version Control from the Rad Studio main menu.
Now choose Git from the dialog which appears.
Now enter the repo’s URL and where you want it to be saved on your local machine
You can find the repo URL on GitHub by clicking on the “code” button
Other hosts are very similar – the keyword to look for is “clone”.
You’ve just cloned your first repository.
If you look in the folder you entered in the ‘destination’ field when you opened the project from version control you should see all the Delphi code for the project there along with the magic ‘.git’ files and folders we talked about. If all you wanted to do was get a copy of an open source repo then there’s nothing else to do but use the code.
Using Git – creating a new repository
I find this is easier if you use one of the external tools rather than the Rad Studio IDE 😲
You can either create a new repo from existing code
Create a blank (empty) repo and then create a Delphi project in there
Either way you need to have an existing folder on your local machine to hold the repo.
I’m using GitHub Desktop.
I have put the name of the repo as the same name as the folder where I will store my source code.
I have chosen to create a “.GitIgnore” magic file with Delphi settings so it ignores _history and .~* backups.
Now my new empty repo is ready to use.
All it contains are the ‘magic’ Git files and in this case an empty default readme file.
Currently the repo is local only – just on your computer. Click on the publish repository button in GitHub desktop to make a copy of it on the cloud hosting company’s storage space.
IMPORTANT! Tick the “keep this code private” checkbox if it’s a secret/private repo.
Using Git – changes get automatically tracked
Using Git – changes get automatically tracked
At first the new repo has only one automatically recorded change.
It may show other files if you used an existing folder which already contained a Delphi project or some resources such as graphics.
As you start to work on your project and create new files they will be ‘noticed’ by Git and automatically tracked.
Using Git – saving the changes to the repo
Mark a batch of changes so they are saved into a history point is called a commit.
There are three ways to “make a commit”:
1. You can do it within Rad Studio Delphi itself by right-clicking on the changed file or the project in Project Manager and selecting “commit”.
2. You can do it via the Windows Terminal (a.k.a the ‘command line’) using the Git command line
3. Or use GitHub Desktop / SourceTree to commit the changes:
Whichever way you choose you need to add a “commit message”.
A commit message is a note to say what you changed and why.
These messages are visible to other developers who have access to your repo.
For Open Source projects this could mean literally anyone so it’s best to keep the comments at a professional level 😁
Using Git – YOU’RE NOT DONE YET
Even though you have committed (saved) your changes to the repo’s history log they still are only on your local machine.
In order for them to go up to the Git repo hosting space you need to push the changes to the remote copy of the repo.
Depending on what way you prefer you can either
On the command line/terminal you use Git push origin master
With Rad Studio, right click on the project root and select “Git” and then “push”, “from Repository Root”
Easiest of all, with GitHub Desktop click on the “Push origin” button
Using Git – You nearly know the basics!
So now we know how to
Download and install Git
Some popular tools for Git
What is Git and how it works
How to clone (get a copy) of an existing repo
How to create a new repo
How to commit (save) our changes
How to push (send) those changes to the remote (“origin”) internet host
Using Git – but there’s more…
Git has a lot of other things we’ve not shown yet. These include:
Fetch – getting any new changes from a shared repo.
Pull – this is confusingly-named; it’s where someone makes some changes on a public or shared repo and would like you to merge them into the main branch of the code.
Resolving merge conflicts – this is where two sets of changes to the same file can’t be merged automatically and someone has to intervene to decide which ones to keep.
Branches and pull requests are the two biggest things you will need to understand.
Because we have limited time for this webinar we can’t show you everything so we’re going to do a part two covering the next stage: Collaborating with other developers using Git.
A few of us have been getting together every Saturday and Sunday for the last ten or so weeks and playing around with live coding in Delphi.
We did this mainly to show some live coding in Delphi of various techniques as well as how to do things like a REST server/client at scale but also to show off some things like TMS Web Core which is a relatively new way of producing web apps using Delphi as the coding language.
This has taken place on Craig Chapman’s ChapmanWorld youtube channel. If you subscribe and hit the bell icon you’ll be notified the next time one of us streams. If you’ve not seen any of Craig’s videos/podcasts before you should pop on over. Craig and I are friends going all the way back to the late 90’s early 2000s when we used to both live in the UK and would rock up at the excellent Delphi User Group meetings at the POSK center in Hammersmith. Times have changed a lot since then. Craig and I are both now living in the USA and married to American wives with American kids. I swear this is something neither he nor I would believe if we could time-travel back to those days in London and tell our 90s ourselves that this would happen!
Others on the videos include Frank Lauter from Germany, Andrea Magni from Italy and I think even Jim McKeeth from Embarcadero in the US also popped in at least once. I apologize if I’ve not name-dropped others (for example, Gus and “The other Ian” both turned up to play almost every week) – in total we’ve collectively streamed 14 FOUR HOUR long episodes of live coding in Delphi.
We’ve been coding a card game and it’s taken ages, but we’ve kind of got to the point where we’re all going to move on to streaming about some other subjects. I will stream and finish the TMS Web Core client part of the game since we’re nearly done with it and it wouldn’t be right to just walk away.
A couple of notes about what’s going on in the stream. I am using TMS Web Core 1.3 running in Delphi 10.3.3 for the code. There is actually a version 1.4 of TMS Web Core out but I didn’t want to swap to using that as it was only released in the previous week and it does do a few things differently – although it also uses a later version of the Pas2JS cross-compiler which would have been helpful. Also, if I had been writing the server side (Frank and Craig did most, if not all of that) I would have used TMS XData and then linked the web client to the data using that in a cross-platform kind of way. I might do that on a stream soon just to show how quick that would have been. 20/20 hindsight is a wonderful thing 😎
Oh and sorry about the glitches with the audio in the first 20 minutes or so. Craig – who directs and hosts the stream – unwisely got some swanky new audio interface stuff and then found out he needed a PhD in audio engineering to actually use it in anger. Stick with it, it gets sorted out as time goes on.
Anyway, I hope you enjoy watching a bunch of Delphi appear before your very eyes on a live stream. We want to do more of this – Delphi is just TOO good at being the invisible driving force behind a lot of products and applications out in the real world and a bit of live streaming showing what Delphi can or can’t do I think can only be a good thing.
So many good things coming in the next release of RAD Studio, especially Delphi 10.4. A ton of stuff will crop up in the next few weeks; blog posts, demos, videos showing off delicious things like managed records, the TTitleBarPanel component and many other goodies.
You’re going to hear a lot of good things about Delphi 10.4 – after all, it is packed with lots of new goodness; fixes, new components, tweaks, managed records (you’ll learn about these and when you understand, you’ll totally get why they rock) – but above all else the Shout From The Rooftops new feature is the implementation of a Language Server Protocol or LSP.
Why do you care about this?
Well, it’s not just that it massively improves the code completion and other in-editor helper functions which in turn improves YOUR productivity when writing code..
No that’s not it;
Nor is it that the “red squiggles” (error insight) will now vanish in a puff of smoke when there’s no error – or that they will remain and be a truthful indication of the ACTUAL state of your code’s correctness when there is a genuine problem
No, not that either.
It’s THE SPEED AND RESPONSIVENESS.
The compiler is already stupid, crazy, fast (you get used to this and it’s a shock if you ever dip your toes in another compiler’s sludgy response and teabreak compilation speed) – but LSP takes all this to another level. FAST FAST FAST.
The sad part is that LSP is so good at just getting on with the job at hand people might not notice in a few weeks time that this is the Oeuvre triumph of the 10.4 compiler team.
If you have access to the RAD Studio Welcome page you’ll see me on it this week taking part in the EMB “Fireside Chat” series with the inimitable Jim McKeeth.
If you don’t have access to RAD Studio or the Delphi IDE then you can view the video directly here:
We cover quite a broad number of things such as fashions in programming (yes they exist, honestly) and converting legacy projects to the latest version of Delphi along with the challenges that brings plus the pros and cons of FireDAC and AnyDac amongst others.
Are you at a loose end and like watching people code live and enjoy hearing coders chatting about code and generally hanging out? Then you might want to subscribe to the Apocalypse Coders live stream.
It’s streamed live on Saturdays and Sundays – sometimes for as long as four hours – and features a group of Embarcadero MVPs and Delphi coders creating a cloud-based card game live on the stream using a multitude of technologies.
I’m one of the MVPs on the stream and you’ll see us using all sorts of coding methods and techniques to produce the server-side services as well as several versions of the client-side apps to showcase various technologies including VCL, FMX/Firemonkey and TMS Web Core. We intend to produce clients for Windows, Mac and Linux as well as a browser-based web client and we might even stretch out and produce iOS and Android clients too if the mood takes us.
We’re not intending to get too serious, it’s more to stream coding in Delphi rather than a huge formal tutorial, but even so we might lay out a few techniques which fellow coders may not have seen or wanted to know more about.
One of the MVPs, Andrea has produced a playlist of the most recent stream as well as an online Delphi Italia event here:
I’ll be there again this Sunday at 9am CST, 8am MNT, 14:00 UTC / BST – you can subscribe to Craig’s ChapmanWorld YouTube channel and get notified when we go live and catch the stream by going here: https://www.youtube.com/c/ChapmanWorldOnTube