A Beginners Guide to Notepad++
Notepad++ Is A Beginner Friendly Code Editor
When you start learning to program you will need somewhere to write your code. If you want to get all of the bells and whistles from the very start then you might like to look at popular 'Integrated Development Environment' (IDE) software such as Eclipse. But IDEs can take time to learn, and if you are just starting out as a programmer then you have enough to learn already without having to navigate your way around a complex new piece of software before you can even begin. Also, large IDEs like Eclipse can sometimes use a lot of computing power to run, so if you don't have a high spec machine to run it on then you may experience some performance issues.
If you want a beginner friendly way to start programming, which is easy to pick up and will have all of the features that a beginner needs, then a simpler 'code editor' may be just the thing for you. A good quality code editor like Notepad++, which is the most popular product for Windows and is my own preferred software, comes with a wide range of useful features and can be extended using plugins.
Even though Notepad++ is less complex that a full blown IDE, there are still a few things you should learn about before you start writing code. This article will guide you through all of the main features and settings, giving you enough information to make the most of what Notepad++ can offer.
How To Install Notepad++
Installing your code editor shouldn't be any harder than installing any piece of software! Software products aimed at developers often have many different versions available to download, without any easily accessible information about how to choose which version to use. This is fine for seasoned developers who know exactly what they want and understand all the technical terms, but when you are just starting out it can be a headache.
With Notepad++ it is easy. Just visit the downloads page and click the first text link to use the 'installer', which will help you by picking out the correct version for you and installing it on your computer with a simple 'wizard' program. The process is the same as it is for any software - in Windows I just click to download then click double-click from my downloads list. Its as simple as that!
When you open up Notepad++ for the first time it is a good idea to customize the settings. Just click the settings button from the navigation bar at the top, then click 'preferences'. If you have the time then it would be beneficial for you to read through all of the options to get a feel for what you can do, but there are three particular things which you should consider changing right away:
- Default Directory: This is the folder on on your computer which the code editor will use as a default location for saving and opening files. Keeping your files organised is very important for a programmer.
- Auto-Completion: Auto-complete works in the same way as it does on Google or on your phone, but its set up to recognize the syntax of programming languages. Some people find auto-complete very helpful and it can prevent you from frustrating errors caused by typos, forgetting to close brackets and so on. But just like with phones, some people don't like it. you can toggle it on and off easily from preferences.
- Default Language: Under the 'New Document' tab in preferences you will see a drop-down box for choosing a default language. If you are going to be coding in the same language all of the time then it is well worth setting this up to match the language you are using.
In addition to the preferences explained above, it is always a nice idea to head over to the 'style configurator', also located under the setting button, which lets you personalize the appearance of Notepad++ by selecting from a range of different themes.
Choosing A Default Language
Notepad++ lets you access most of its handy features using keyboard shortcuts (using your keyboard to access functions instead of using the menus, like hitting control and s to save, which is a commonly used keyboard shortcut). These are not only great for saving time, they can also help you out when you are stuck. You can see the shortcuts keys next to each item in the navigation lists. Check out some basic ones to begin with by clicking the 'Edit' button from the navigation and scrolling down to the third section of the list.
Here are a couple of examples of how you can use keyboard shortcuts:
- Comment out a block of code by highlighting it and clicking ctrl + Q
- Autocomplete functions - if you can't remember the name of the function you need, want a reminder of what functions are available, or are just too plain lazy to type, then you can click ctrl + space to insert functions from a list.
Please note that to use these the software has to know what language you are writing in. If you have set up a default language then you don't need to worry, but otherwise you will have to select a language (click 'languages' from the navigation bar) to enable these features.
A Beginners Guide to Notepad++ Plugins
Plugins allow you to quickly and easily add new functionality to your Notepad++ program. If you click 'Plugins' and then 'Plugin Manager' from the navigation bar you will see that there is a wide range of free plugins available for you to install. Adding a plugin is as easy as ticking a box and then clicking install - the program will need to restart to finish adding the plugin, but of course it will offer to do that for you.
If the list is too long for you to want spend the time reading the descriptions which are provided for each plugin to find something useful then don't worry - I have a couple of suggestions. My first suggestion is to install AutoSave. You can set it up to automatically save your document according to whatever time schedule you prefer; the default setting is once per minute. This can be useful for anyone, regardless of which language you use. My second tip is to scroll down to the first letter of the language you are learning. For example, if you are learning Python then scrolling down to the letter P will bring up at least three plugins for Python programmers. You won't find every plugin that could be relevant to your language like this, but it's a good place to start. For my example of Python code, PyNPP is a good tool which lets you run your code from Notepad++ rather than having to go over to the GUI or shell to run it, and Python Indent is great for helping you with formatting.
Search and Replace Features
Like any good code editor Notepad++ offers you a range of features to finding things in your code, and for bulk editing.
- Find brings up a dialogue box which lets you find every instance of a word and perform actions on it. You can access the replace function listed below from here, count the number of times a word occurs, or mark each line where a word is found for your own reference. You can also use 'find next' or 'find previous' by highlighting a word and then using the keyboard shortcut to skip the next time, or the previous time, that this word appeared in your code.
- Replace allows you to quickly replace every occurrence of a word through a document, which is handy if you need to change the name of a variable, for example.
- Incremental Search takes you to the first occurrence of a word, and from there you can skip forwards to the next occurrence with an arrow button.
Don't Repeat Yourself - Unless Using Macros
OK, so I know that most beginners opening up Notepad++ for the first time and looking about at the various features will be wondering what the hell 'Macros' are and what those play and record buttons are doing in a text editor.
Macros are a very handy tool that can automate boring repetitive tasks.
The golden rule of programming is DRY - don't repeat yourself - but macros are the one exception to this rule! If you find yourself writing the same piece of code over and over again you should generally create a function which you can call to run that code for you. This saves you time and hassle and makes your code less bulky and more readable. But sometimes there are things that you can't avoid repeating and which you can't create a function for - this is where macros come in. You can use them to very literally 'repeat yourself' by recording yourself performing a task once, and then playing it back to repeat that action wherever and whenever you want! Once you record a macro you can save it and even assign it to a shortcut.
A good example of where using Macros can save you a lot of time and tediousness is shown in the video below, which walks you through each step of the process.
More by this Author
Free alternatives to Microsoft word - a list of the best open source word processors you can install on a Windows computer.
A guide to Linux free, open source operating systems for complete beginners.
A beginner's guide to the dark net—how to access it, where to go, and what you will find when you get there.