Functions and Subs and void, OH MY!

So far in this chapter and in this book you’ve been dealing with code blocks that are self-contained, or in other words, that do all the work within themselves. What if I told you there was another way in certain instances to write less code, reuse code, save loads of time when you’re debugging, and separate out your code into compartmentalized blocks that are easier to use and to read? Would that be exciting? Okay, you’re not gonna jump out of your chair and do cartwheels, but it is a little exciting, isn’t it?

Functions and subs, enter stage right. Functions provide a great way to achieve all the above-mentioned benefits and probably many more I can’t think of. They give us a way to use blocks of code over ...

Get ASP.NET for Web Designers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.