\chapter{Preface}

	\section*{This book is for novices}
		If you have never done any programming before - if you are a complete novice - this book is for you. This book assumes no prior knowledge of programming. It starts from scratch. It is written in a simple, direct style for maximum clarity. It is aimed at first level students at universities and colleges, but it is also suitable for novices studying alone.


	\section*{Why Visual Basic?}
		Visual Basic is arguably one of the best programming languages to learn and use in the 21st century because:
		\begin{itemize}
			\item	Visual Basic is one of the most widely-used programming languages in the world today.
			\item	Object-oriented languages are one the and most successful approach to programming. Visual Basic is completely object-oriented from the ground up.
			\item Visual Basic is a completely general-purpose language. Anything that C++, Java, etc., can do, so can Visual Basic.
			\item	Visual Basic is a simple language and most of its functionality is provided by pieces of program held in a comprehensive library.
		\end{itemize}


	\section*{You will need}
		To learn to program you need a PC running a recent version of Windows and the software that allows you to prepare and run Visual Basic programs. You can download and install Visual Basic 2017 Community Edition, which is free of charge from the Microsoft website.


	\section*{Versions of Visual Basic}
		Visual Basic is a fully-fledged object-oriented language, supporting encapsulation, single inheritance and polymorphism. It is an elegant and consistent language. This makes it easier to learn, easier to use and programs more robust. In addition it encourages the use of good programming style.
Here is the recent history of Visual Basic:
		\begin{itemize}
			\item	Visual Basic 6 not object oriented
			\item	Visual Basic .NET	object oriented, incompatible with Visual Basic 6
			\item Visual Basic .NET 2005	introduced generics (see chapter 13), simpler development environment
			\item	Visual Basic .NET 2008	minor changes to the development environment, 
			\item	Visual Basic .NET 2010	minor changes to the development environment, no other changes that affect this book
			\item Visual Basic .NET 2015 	major changes to some language features e.g. recognition of string continuation (e.g. recognition of newlines), removal of "\_" for line continuation, \keyword{ByVal} as default. The changes have been incorporated in this book. Also, the development environment layout has changed.
		\end{itemize}


	\section*{The approach of this book}
		We explain how to use objects early in this book. Our approach is to start with the ideas of variables, assignment and methods, then introduce using objects created from library classes. Next we explain how to use control structures for selection and looping. Then comes the treatment of how to write your own classes.

		We wanted to make sure that the fun element of programming was paramount, so we use graphics right from the start. We think graphics is fun, interesting and clearly demonstrates all the important principles of programming. But we haven't ignored programs that input and output text - they are also included.

		The programs we present use many of the features of graphical user interfaces (GUIs), such as buttons and text boxes. But we also explain how to write console programs.
	
		We introduce new ideas carefully, one at a time rather than all at once. So, for ex-
ample, there is a single chapter on writing methods. We introduce simple ideas early and more sophisticated ideas later on.


	\section*{What's included?}
		This book explains the fundamental ideas of programming:
		\begin{itemize}
			\item	variables;
			\item	assignment;
			\item	input and output using a GUI;
			\item	calculation;
			\item	repetition;
			\item	selection between alternatives.
		\end{itemize}
		It explains how to use numbers and character strings. Arrays are also described. These are all topics that are fundamental, whatever kind of programming you do. This book also thoroughly explains the object-oriented aspects of programming - using objects, writing classes, methods and properties, and using library classes. We also look at some of the more sophisticated aspects of object-oriented programming including inheritance, polymorphism and interfaces.

	\section*{What's not included?}
		This book confines itself to the essentials of Visual Basic. It does not explain all the bits and pieces, the bells and whistles. Thus the reader is freed from unnecessary detail and can concentrate on mastering Visual Basic and programming in general.

	\section*{UML}
		The Unified Modeling Language (UML) is the current mainstream notation for describing programs. We use elements of UML selectively, where appropriate, throughout this book.

	\section*{Applications}
		Computers are used in many different applications and this book uses examples from all areas including:
		\begin{itemize}
			\item	games;
			\item	information processing;
			\item	scientific calculations.
		\end{itemize}
		The reader can choose to concentrate on those application areas of interest and ignore other areas.

	\section*{Exercises are good for you}
		If you were to read this book time and again until you could recite it backwards, you still would not be able to write programs. The practical work of writing programs is vital to becoming fluent and confident at programming.

		There are exercises for the reader at the end of each chapter. Please do some of them to enhance your ability to program.

		There are also short self-test questions throughout the text, so that you can check you have understood things properly. The answers are given at the end of each chapter.

	\section*{Have fun}
		Programming is creative and interesting, particularly in Visual Basic. Please have fun!

	\section*{Visit the book's website}
		Work in progress! 	The website will include: the source code of all the programs in this book; source code of the book,…

	\section*{Changes for this edition}
		The latest version of Visual Basic is called Visual Basic 2017 (VB 15.0). This book uses the best of what is new in the 2017 version. We have not included every new feature, because our judgement is that some of them are not appropriate in a book aimed at novices.

		The changes from the previous editions are in the many screenshots and \Cref{ch:visual-studio}, The VB Development Environment, which is changed to capture Visual Studio 2017.

	\section*{Additional notes}
		The original authors, Mike Parr and Douglas Bell, were kind enough to let this book continue and be updated to reflect the newest additions in Visual Basic by Nils Bausch, who is currently teaching Visual Basic \emph{to} undergraduate students.

		The book's sources are freely available on Github and any comments and suggestions are welcome!


