[Pitch] Last expression as return value

Great comment @austintatious, fully agreed.

Besides, if we go a bit higher-level, I think we should acknowledge that keywords not only bear some function in the language, they also serve as visual markers for scanning and understanding the code faster, especially in IDE's, but not only.

There are probably a few other places where Swift's syntax could be simplified by removing a keyword but the price of reducing discoverability by removing an important marker may outweigh the benefits.

Being a staunch minimalist myself as an engineer, I cheered the removal of return in single-line function bodies. I cheered the shorter if let construct (who didn't?) and many other improvements. But this one crosses a certain line that I can't agree to.

17 Likes