chapter 5 Flashcards
Explain how interpreted, compiled and hybrid languages work and differ from eachother
Compiled programming languages: in these languages such as C# or C++, a build step is necessary to translate the source code into executable machine code. This code can then be directly executed by the computer
Interpreted programming languages: unlike compiled languages, interpreted languages like python do not require a build step, instead the source code is executed line by line by an interpreter when you run it
Hybrid programming languages: hybrid is both compiled and interpreted, the code is compiled into bytecode, this bytecode is then executed by the java VM which interprets at runtime
Explain what installing actually is
Installing typically refers to the process of placing files, such as executable files or dynamic link library (DLL) files onto a computer system in a way that allows them to be used by other programs or the operating system itself
Breakdown of what installing generally entains:
Copying files: copying the necessary files to a specific location on the computers hard drive
Registering components: in case of dll files they often need to be registered in the operating systems registry so that programs can locate and use them. This typically involves updating the registry with information like location and any dependencies the dll files have
Configuring settings: installation processes often involve configuring various settings or options in configuration files based on user preferences or system requirements and making shortcuts
Finalizing dependencies: installation process may involve installing or updating other software components or libraries that are already present
Describe how C# and Java are cross-platform and how they try to combine benefits of strictly interpreted and compiled languages
To be considered cross-platform it means that software developed in that language can be executed on multiple operating systems without needing significant modifications
Describe what Maven is and how it works in general for Java projects
Maven is a powerful build automation tool primarily used for java projects. It helps manage libraries, build processes and project documentation. When you click the run button in IntelliJ especially for maven projects, several steps are executed by maven behind the scenes to ensure your code runs smoothly
Explain what different parts of a pom.xml file do in relation to Maven: project, modelversion, groupid, artifactid, version, java.version, dependencies, build, plugins
Project: the root element of the POM (project object model) file
Modelversion: specifies the version of the POM schema being used
groupId: specifies a unique identifier for your project’s group or organization its typically based on a reversed domain name like com.example
artifactId: specifies the name of the project or artifact, this is the name you give to your project
version: specifies the version of the project
java.version: specifies the version of java required for the project
dependencies: specifies external libraries or dependencies required for your project to compile and run
build: contains configuration for the build process
plugins: specifies additional build plugins or extensions used during the build process
Describe what the commands mvn compile, mvn test and mvn package do and how/when they are integrated into a GitHub Actions workflow
Mvn compile: if you run this command inside command line in the folder where the pom.xml is located it wil compile the code
Mvn test: if you run this command inside command line in the folder where the pom.xml is it will run all the unit tests that developers coded and will show how many tests failed, got errors and where skipped
Mvn package: if you run this command inside command line in the folder where the pom.xml is located it will compile the code, test the code and it will package the code into a distributed format specified in the projects POM
Explain what a unit test is and what its role is
Unit tests are a type of test that focus on testing individual units or components of your code in isolation