-->
One of the most essential debugging tools is the print statement. Being able to print something to the console quickly without questioning the syntax is a skill many developers hone early on. Unfortunately, not all languages print the same.
The cotr-snippets VS Code extension includes two snippets to help reduce the friction of moving to a new programming language:
cotrPrint
: Prints a single line of text to the consolecotrPrintMulti
: Prints a multi-line text to the consoleThis article shows what each of these snippets creates in all of the supported COTR languages.
cotrPrint
The cotrPrint
snippet in Dart creates the following code:
This will print a single line of text to the console in Dart.
cotrPrintMulti
The cotrPrintMulti
snippet in Dart creates the following code:
This will print multiple lines of text to the console in Dart, with each string on a new line.
cotrPrint
The cotrPrint
snippet in JavaScript creates the following code:
This will print a single line of text to the console in JavaScript.
cotrPrintMulti
The cotrPrintMulti
snippet in JavaScript creates the following code:
This will print multiple lines of text to the console in JavaScript, with each string on a new line.
cotrPrint
The cotrPrint
snippet in TypeScript creates the following code:
This will print a single line of text to the console in TypeScript.
cotrPrintMulti
The cotrPrintMulti
snippet in TypeScript creates the following code:
This will print multiple lines of text to the console in TypeScript, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Rust creates the following code:
This will print a single line of text to the console in Rust.
cotrPrintMulti
The cotrPrintMulti
snippet in Rust creates the following code:
This will print multiple lines of text to the console in Rust, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Go creates the following code:
This will print a single line of text to the console in Go.
cotrPrintMulti
The cotrPrintMulti
snippet in Go creates the following code:
This will print multiple lines of text to the console in Go, with each string on a new line.
cotrPrint
The cotrPrint
snippet in C++ creates the following code:
This will print a single line of text to the console in C++.
cotrPrintMulti
The cotrPrintMulti
snippet in C++ creates the following code:
This will print multiple lines of text to the console in C++, with each string on a new line.
cotrPrint
The cotrPrint
snippet in C# creates the following code:
This will print a single line of text to the console in C#.
cotrPrintMulti
The cotrPrintMulti
snippet in C# creates the following code:
This will print multiple lines of text to the console in C#, with each string on a new line.
cotrPrint
The cotrPrint
snippet in PHP creates the following code:
This will print a single line of text to the console in PHP.
cotrPrintMulti
The cotrPrintMulti
snippet in PHP creates the following code:
This will print multiple lines of text to the console in PHP, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Python creates the following code:
This will print a single line of text to the console in Python.
cotrPrintMulti
The cotrPrintMulti
snippet in Python creates the following code:
This will print multiple lines of text to the console in Python, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Java creates the following code:
This will print a single line of text to the console in Java.
cotrPrintMulti
The cotrPrintMulti
snippet in Java creates the following code:
This will print multiple lines of text to the console in Java, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Kotlin creates the following code:
This will print a single line of text to the console in Kotlin.
cotrPrintMulti
The cotrPrintMulti
snippet in Kotlin creates the following code:
This will print multiple lines of text to the console in Kotlin, with each string on a new line.
cotrPrint
The cotrPrint
snippet in Swift creates the following code:
This will print a single line of text to the console in Swift.
cotrPrintMulti
The cotrPrintMulti
snippet in Swift creates the following code:
This will print multiple lines of text to the console in Swift, with each string on a new line.
Copyright © 2024 Code On The Rocks. All rights reserved.