Code Blocks | Friendly syntax highlighting

One of the challenges of documenting source code (and this used to be the case in IB Computer Science student work submissions for internal assessments until they moved it all online in 2007) was the formatting issues that came with it. Since students would often choose a wide range of programming languages to write in, making sure the code was readable when documented – in say Word or Google Doc – was always a challenge. When I started my 100 day daily coding challenge (which is now becoming a 365 day challenge!) I wanted a solid way to document my code (in addition to my GitHub). So I looked up Google add ons and found Code Blocks.

It’s a simple to install and use add on that takes your copy pasted code and allows you to format it in a wide range of different languages. What I liked about this feature was its dynamic nature in assigning specific indentations and spacing to the code depending on the language selected for the formatting. 

Example of usage

Once installed, the add on shows up on your menu bar for any Google Doc you create. Paste the code you wish to format and activate the Code Block option. The easy to use interface on the right allows you to choose the language and the theme (which is a good feature too). By default I choose the landscape page layout for code so that there is room for comments etc.

Sample usage screen shot

I support clear and well laid out documentation for all source code. If students start using tools like this in maintaining a work habit of legible and well formatted code, then chances are they will aim towards more minimalism in their coding logic (another blog post coming on this soon!)

“Smile – Brand design” by Graphéine is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit:

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.