Link Search Menu Expand Document

File types and encoding

This section is an introduction to some of the necessary logistics of coding. Students should understand that code is stored in files, that different programs are able to decipher different types of code or encoding, and that it is possible for humans to write code using special plaintext editors.

Topics

File types

Talk about different file types as a way of showing that there are many ways to format a document, and HTML/CSS are just one way.

Text editor

Text editors, such as Atom, are programs specifically designed for writing code. When you open a document using a text editor, documents are shown in plaintext without any other formatting. Thus, if you open files that have a type of encoding, you will see the code, not the rendered output or rich text. The file extension tells us what type of encoding will be used and which program should open it.

Exercise

Demonstrate that handwritten code needs to be edited in plaintext, in a special editor (not MS Word), and given a special extension. HTML files can be opened by either a browser or an editor. The same exact document can be encoded in different formats.

Using Atom, open a HTML file, a Word document, and a PDF. How do each of these files look when opened in a plaintext editor?