One of the big limitations we had in C/AL was the impossibility to return complex types in functions. We could only use simple data types as Code, Text, Boolean, Integer, etc. Every time we needed to return, for example a record, we used the Var parameter.
We are happy to announce that starting on Business Central 2021 release wave 1, Microsoft added the possibility to return user defined types like for example records, pages and codeunits. Also new data types as HttpClient or HttpResponseMessage is possible to use.
Examples of code you can write:
Official documentation from Microsoft is available here https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-complextypes.