Skip to content

Language Guides

Bacchus Jackson (BJaX) edited this page Jul 22, 2024 · 1 revision

Introduction

These language guides are a collection of resources developers can use based on their chosen tech stack, framework or programming language.


Java

Java is a popular object-oriented programming language that can be run on pretty much any device. This is all possible thanks to the Java Virtual Machine, a software application that runs Java byte code.

Java Development Kit (JDK): The JDK contains the development tools, including the javac compiler that turns the Java source code into JVM-compatible byte code. The JDK also comes with a JVM and a JRE.

Java Virtual Machine (JVM): The JVM takes the bytecode and translates it to machine code targeted for the underlying operating system at runtime.

Java Runtime Environment (JRE): The JRE also has the necessary library files to run a Java application. Once the application is packaged, only a JRE for the target operating system is required.

Java Source Code to Bytecode

Package Managers & Build Tools

Maven

Maven – Welcome to Apache Maven

Docker Hub | Maven

Maven is used to manage dependencies, build the Java application, and package it for distribution in the JAR or WAR formats. It also has lifecycle features to include release management and an extensive collection of plugins.

Maven uses XML for its Project Object Model (POM), which can be difficult to manage. It is also not the most performant when downloading dependencies and plugins.

Gradle

Gradle Build Tool

Docker Hub | Gradle

Gradle is highly customizable because the build scripts are written in Groovy or Kotlin DSL. It handles package dependencies very well and has great integration with IDEs and other tools.

The only downside seems to be the learning curve since Gradle can do quite a lot compared to other build tools.

Java Development Kits

There are many JDKs, all with their pros and cons. While this is not intended to be a comprehensive list, it covers the most popular options today.

Oracle JDK

Oracle Java

Oracle owns Java, and their JDK is technically the "official" one. It's the go-to choice for enterprise environments that require support, stability, and regular updates.

Unfortunately, with their license model, enterprise users must have a paid subscription if they're using the JDK for commercial use cases.

OpenJDK

OpenJDK

Docker Hub | OpenJDK (Deprecated)

This is an open-source and free-to-use implementation of Java Standard Edition under the GPLv2 License.

While it is heavily community supported, it may not have the same optimizations and enterprise support you'd get with the Oracle JDK. However, it is widely used by developers and organizations.

Amazon Corretto

OpenJDK Download - Corretto - AWS

Docker Hub | Amazon Corretto

Backed by Amazon, Corretto is a distribution of OpenJDK with patches designed to improve performance and stability all under the GPLv2 CPE license. The Long Term Support (LTS) versions receive quarterly updates at no cost until the designated End-of-Life (EOL).

AdoptOpenJDK / Temurin

Home | Adoptium

Docker Hub | Eclipse Temurin

AdoptOpenJDK is backed by the Eclipse Adoptium project and provides OpenJDK binaries built, tested, and distributed by its community.

It has the same downsides as OpenJDK with a bit of additional community support.


Python

Python is a high-level, interpreted programming language known for its simplicity and readability.

Python source code is compiled into bytecode, a .pyc file, and then executed by the python virtual machine included with the interpreter.

Python Source Code to Interpreter

Package Management & Virtual Environments

Virtual Environments are essential for python for the following reasons:

  • Isolation of Dependencies: Different projects may require different versions of the same package. Installing packages globally can also conflict with system-wide applications that use python.
  • Reproducibility: Python is not statically compiled so the dependencies are assumed to be on the execution system. Without a virtual environment, there is no way to guarantee that the package versons match between the dev and prod environments.
  • Upgrades & Rollbacks: Using a package manager makes it easy to upgrade packages when new versions are released and also rollback if an upgrade breaks the software.

pip: The default package manager for python used to install dependencies and libraries from the Python Package Index (PyPI).

conda: A package and environment manager commonly used with the Anaconda distribution, common in scientific computing and data science.

poetry: A package manager with more advanced dependency resolution techniques compared to pip with automatic environment management.

Pipenv

Pipenv

The officially recommended tool for managing dependencies and virtual environments by the Python Packaging Authority. It replaces the traditional requirement.txt dependency list with a Pipfile and also includes a Pipfile.lock which ensures deterministic and reproducable builds. It automatically creates virtual environments to target specific versions of Python should that be required.

Poetry

Python Poetry

Poetry is a modern third-party tool developers use to manage dependencies and automatic virtual environments. There is significant overlap with pipenv in terms of features but poetry has a few more features specifically for publishing packages on PyPI. It uses the pyproject.toml file for project configuration and dependency declaration and poetry.lock for reproducibility.