@Theo Stolker I'm not sure what you mean by, "I never liked the different behavior of embedded sql, like when you have no result, you have no easy way to find that out." When you run an embedded query, it sets a variable called SQLCODE. If SQLCODE = 0, query completed with results. If SQLCODE = 100, query completed with no results. If SQLCODE < 0, there was an error with the query.

FYI, in your "Building SQL In Strings" section, you can also still use %SQL.Statement like this:

set stmt = ##class(%SQL.Statement).%New()
// Note the question mark in the query.
set query = "SELECT Name, Age FROM Patient WHERE ID=?"
set sc = stmt.%Prepare(query)
// You can add error handing here if the above status results in an error
// Providing variables to the %Execute method will insert them where the question marks are in the query, in order
set rs = stmt.%Execute(id)

Combining what you said about error handling and transactions and also returning a status, a very basic outline for a lot of methods could be something like:

try{
    TSTART
    //Do stuff here
    TCOMMIT
    return $$$OK
}
catch ex{
    if $TLEVEL > 0{
        TROLLBACK
    }
    return ex.AsStatus()
}

Some of us who write articles could do a better job of making this easier for you too, though. We like to use short forms of certain things, like {} and [] which are ##class(%Library.DynamicObject) and ##class(%Library.DynamicArray). I try to remember to use the latter in my articles just because it makes it easier to find the thing I'm talking about in the documentation. There are cases like that which are technically correct, but make it harder for beginners to learn.

I just now took a closer look at this because of a comment made on one of my ideas on the idea portal, and that's great news for us! Our software is an ERP system, and we have some customers who have multiple locations that they sell things out of. We generally have them share one code database, but different global databases. The old way, where it stored the table tuning statistics with the code, made it unusable for us because each of those locations would have different orders, invoices, customers, etc., so tuning the table would help one namespace and potentially harm the others!

In ObjectScript, you would do:

new $NAMESPACE
set $NAMESPACE = "USER"

In embedded Python, you can execute those commands using iris.execute:

import iris
iris.execute('new $NAMESPACE')
iris.execute('set $NAMESPACE = "USER"')

I am not far enough into embedded Python to know if that's considered a best practice or if there's another way, but it does work. Here are my results in a Python shell terminal session:

>>> print(iris.system.SYS.NameSpace())
USER
>>> iris.execute('new $NAMESPACE')
>>> iris.execute('set $NAMESPACE = "%SYS"')
>>> print(iris.system.SYS.NameSpace())
%SYS

There are some naming conventions in the documentation already. Here's one example. I think there used to be more. I know there was one for Zen pages that suggested naming methods based on what was client side or server side or a Zen method. I thought there was also one that explained how things were named in the system classes, but I can't find that one in the current documentation.

I have no strong opinion about whether they are (or were) right or wrong. I think we just need to be aware that some of these are still out there, and people may be using them.