Using Programming Languages in VSCode

Overview

This week in class, my group and I installed Java in VSCode and created a unique file to write code in. It was the first time that I created a file that wasn’t in BlueJ or ZyBooks in order to write runnable code inside of. Being it was my first time experimenting with it, it took a while for me to understand. But once it became clear to me I found it very interesting. A tutorial on getting started with Java in VSCode I read went further into detail on how to use Java in it, covering tools, testing, project management, what needs to be installed and many other helpful things.

Installing Java

To first get started a coding pack needs to be installed. There’s a link leading to the files that need to be downloaded. However, the Development Environment activity we did in class only required that the Java devcontainer extension packs in VSCode were installed. Installing that same extension pack is actually the second step for the article’s “Hello World” example. A JDK (Java Development Kit) is vital for running Java in VSCode. With the coding packs and the JDK, Java has been successfully installed onto VSCode.

Creating Source Code Files

The part that fascinated me was creating a source code file. Since the Java coding packs and development kits have now been installed, you can create a file specifically for Java code. This is achieved by choosing a name for your file and adding “.java” to the end of it. VSCode now knows that it is a java file and will recognize any terms and symbols specific to Java that it wouldn’t if it was just a regular text file. Write down code and it won’t take you long to notice that terms like “int”, “for”, “public”, “class”, etc. are colored differently. When you are done writing your code, there should be either a play symbol or a link that says “Run|Debug”. If your code is compilable, the output of your code will be returned in the terminal. 

Interesting Features

VSCode offers many interesting tools that make it easy to search for, test, and edit code among other things. If you have a project in Java or any programming language, it is easy to sort through. On top of that, there are so many extensions such as code spell checkers, debuggers, test runners, and many other tools that make creating code that much easier. Compared to BlueJ and other IDEs I’ve used, this has been the most useful. It took a while to get the hang of, but once I did, I realized how good of a tool VSCode is and can potentially be.

Source

https://code.visualstudio.com/docs/java/java-tutorial

Design a site like this with WordPress.com
Get started