`
Following coding standards is important for students because it prepares them for professional development. Often in the selection process of product companies, interviewers look for if student is writing clean and structured code. Students who follow these guidelines early on are better prepared for internships and future careers, where they will be expected to work on large, complex projects with teams.
Development enviornments like Eclipse, VSCode etc have inbuilt tools which automatically formats the code e.g. indentation. However, there are still lots of guidelines which students do not incorporate while coding such as comments, following naming conventions amongst others.
This article covers tools for Java and C/C++ which students can run and ensure compliance with industry standards. This will help build them muscle memory to always write clean and structured code. This will also be essential for students while developing projects and submitting to comapnies during the campus placement.
Checkstyle is a development tool to help programmers write Jave code that adheres to a coding standard. It can find class design and method problems, code layout and formatting issues. The latest release of CheckStyle can be downloaded from here.
Checkstyle can be run on your Java file using the following command
java -jar <path to checkstyle jar> -c google_checks.xml <path to java file>
Cpplint is an open-source command-line tool designed to check C++ source code for conformance to Google’s C++ style guide. it functions as a static code analysis tool focusing on style and formatting issues.
On Ubuntu, Cpplint can be installed using following command
sudo apt-get install cpplint
Cpplint can be run on a C/C++ file using the following command
cpplint <path to C/C++ file>