Have you ever wondered how most of the moving parts in the backend of a software solution are able to communicate with one another (or at least have data ready whenever the part is called) then today is your lucky day, if you never wondered about it, today is also your lucky day ๐.
A RELATABLE EXPLANATION
A lot of times, classes (blocks of code) are used to borrow data, process it and wait till it is called before providing the data. It would be very unreally inefficient if classes simply wait till they're needed before performing their set responsibilities. The "Return" keyword is what is used to ensure that classes and other constructs are able to provide data when called upon. Also, the "Return" word is used to terminate the operation of a block of code. As such, the program ignores everything written after the "Return" line.
FINALLY
Think of most things you query the database for; search, delete, update, modify and others, the "Return" word or its similar counterpart ensures that you're able to receive feedback at the end of the activity you're undertaking. In the interest of brevity and word economy, I will keep today's post short (because so as not to lose the message). The key takeaway is that software solutions are able to provide responses under certain circumstances due to the "Return" keyword, see you tomorrow ๐.