- [Craig] In this video, we look at integrated development environments
and some of their common features.
(uplifting piano jingle)
So, an integrated development environment is a set of tools which help and aid you in writing computer programs.
Now here we're looking at a very common IDE available for writing programs in Python called IDLE.
Now at first appearance, it may actually seem an incredibly simple, low-feature IDE,
especially when compared to one such as Visual Studios, but actually,
there's a lot of features available in IDLE which help you write and debug a program.
Let's look at some of them now.
So you can see here we've got automatic highlighting of where a syntax error has been found.
Now, these first two lines of code were actually meant to be a comment.
If I go to the format menu, you can see I have an option here.
I could also use Alt plus the number three to comment out blocks and sections of code.
So if I give this another compile, you can see I've got another error here on the fourth line down.
This is because I've got incorrect indentation.
Again, the error has been highlighted by the IDE.
I can highlight the four lines of code and again, in the format menu,
you can see I've got an option to indent all four lines of code.
Another quick, easy, simple feature for helping you with development in Python.
Here we also see down the bottom a runtime environment and an output window.
So there's a window here being supplied to you that's providing you with error messages,
providing you with output to the program.
Here we see the option to open a debug window,
and this provides us with lots of tools and additional information when a program is running.
So let's run the program again and see what happens.
Well the first thing you can do with this debug window is
you can step through the program one line at a time while it's executing.
Instead of the program going ahead and just executing all the way through,
you can deliberately step the program manually, one line at a time.
It shows you in this output window exactly what's happening and what line of code was just executed.
You can see down the bottom that the current contents of various variables and other data structures,
and you can see how they're changing or updating as you step through your program.
So you can see here the program's done one iteration of our loop
and printed out there are nine green bottles sitting on the wall.
And you can see at the bottom there the current contents of counter are now eight.
This is great for helping you debug a program as you can step through it line by line,
watching the contents of the variables change live in memory as the program is executing.
We also see we have the ability to change the font type and font size used by the IDE,
although I'm not suggesting what I've chosen here is actually any better.
We can even change the way various keywords and syntax are highlighted and coloured up by the IDE.
So let's just have a little recap then of some of these common features which are prevalent in the IDLE IDE.
And these are features which can be seen in many different IDEs.
So the first is that many IDEs help with the various keywords and syntax.
For example, you could start typing a keyword such as input and then the IDE often prompts you,
telling you that what's required next is an open bracket and then some form of string or prompt.
Different IDEs provide you with different levels of support,
but they actually structure you and help you to write the code correctly.
Virtually all IDEs allow you to change the size of the source code
and indeed the different colours of keywords in the source code.
This can be really useful for people with various disabilities or eyesight problems, people who are colourblind.
Most IDEs have a find and replace system just like you'd have in a word processor.
When you write quite large programs,
this can be really useful if you suddenly later decide to change the name of a particular variable.
You can change it in all locations at once and you don't accidentally miss one.
The ability to automatically comment out and indent sections of code
is just another facility which helps speed up program development,
especially in larger programs.
You may have discovered a bug in a particular subroutine
and want to comment out the entire subroutine to check if your error still occurs.
Highlighting the subroutine and pressing a keyboard shortcut
will instantly comment out an entire block of code.
Most IDEs provide you with some sort of runtime environment and output window, and this is really useful.
You have to remember that not every single computer program will display output to a screen.
Indeed, many embedded systems won't have any sort of visual output at all,
so it's useful to have a runtime environment so you can see what is going on.
All IDEs tend to provide you with various debugging tools.
One very common feature is the ability to manually step through your code line by line as it is executing.
Some IDEs actually allow you to put break points in your code.
This means you choose a specific line of code and then run the program.
The program will run normally until that line of code has been reached.
The program then breaks at that point and you manually take over stepping through it.
We see here the ability to trace the current contents and the current values of variables.
This can be really useful when trying to debug and find logic errors in your program.
Here is an example of the Visual Studios integrated development environment
which is developed by Microsoft.
It's used for helping to write program and debug and test a range of languages such as Visual Basic, C, C Sharp, etc.
This is a much more complex IDE than the one we just showed you for Python.
But again, many of the features that you saw there can also be seen here.
We have syntax highlighting, we have auto code completion to help you write the program.
We have automatic indentation and a window down the bottom where errors will be output.
We have a whole host of main menus and toolbars, and we have a project navigation panel.
All of these tools of IDEs are simply designed to make
programming, testing and debugging programs faster, easier, and more efficient.
Here is a recap of the most common characteristics provided to you by IDEs.
Pause the video and take some notes.
(uplifting piano jingle)