Editors - Additional Information

Selecting an Editor

The decision on which editor to use is very much a subjective one. For example, both Visual Studio Code and Sublime Text 3 are well-known and more than capable of allowing lab completion.

Both can be extensively customised to support syntax highlighting, package control, debug and a host of other features. With the exception of the C# Windows Forms Lab, both can be used to achieve the exact same goal: the creation of scripts and apps based on lab guides.

The decision in your own environment will likely be driven by two things, although both could be considered subjective, too.

  • Visual Studio Code is, in July 2019, 100% free whereas Sublime Text 3 is free to try, then requests you to purchase a license ($80 USD in July 2019).

  • The need to use software from a commercially “recognised” vendor like Microsoft, vs a smaller software developer like Sublime HQ.

Of course, it is entirely possible that neither of those things matter to you at all, in which case both are excellent choices.

There’s also the possibility that you are an advanced user, in which case you may be comfortable editing code in vi, vim or some other core editor. That’s perfectly OK, too!

Note

Although this lab only discusses three editors in total, there are literally hundreds of other editors available. If you already have a preferred editor, please feel free to skip this section entirely. This section is aimed primarily at those who don’t have an existing editor or those unfamiliar with code/text editors as an overall concept.

Built-in editors

Linux, OS X and Windows are all pre-installed with “system” editors or editors that probably aren’t recommended for writing code. For example:

  • Linux: Text Editor

  • OS X: TextEdit

  • Windows: Notepad or Wordpad

The short version:

It is not recommended to use any of these built-in editors to write your code. They can make unexpected changes and lack the ability to be extended or customised for specific development tasks.

The long version:

These basic applications can sometimes be known as “Smart Editors” due to making “smart” changes as you type. This also applies to word processing applications, e.g. Microsoft Word on Windows and Mac, or LibreOffice on Linux. An example of this would be the quotation-mark or double-quote character - . The built-in editors will sometimes change the double-quote character to a smart quote or “curly quote”. In nearly every case, smart/curly quotes are not supported as string-delimiters i.e. a valid character for the opening and closing of a string variable (more on those in other labs).

Another example would be typing three “dots” or full-stop characters (…). “Smart” editors will sometimes substitute the three dots with a single “horizontal ellipsis”.

Here’s an example:

../_images/smart_quotes.png

This may seem to be something basic that doesn’t need explaining, but the automatic substitution of characters as outlined above can quickly prevent code from running at all, especially when copied and pasted from an online source (e.g. a web browser). While it is true that these editors can be configured to not make these automatic substitutions, they also lack the ability to be configured as “real” code editors, like those shown below.

At this point please go back to the previous page and continue with choosing and installing an editor.