i’d like to add that, while top-level code could be considered beginner-friendly, “beginners” are not the only people who might have a use for top-level code. i myself have at times felt frustrated that single-file Swift scripts with top-level code don’t just do the Right Thing by default.
5 Likes