The Python Advantage: Why It Remains a Top Choice in Tech

November 2, 2023
Featured Image

Python is one of the most popular programming languages in the world. From recommendation algorithms to self-driving cars and robotics, the use case possibilities are endless. In our quest to explore the dynamic world of Python, we sat down with Darshan, a seasoned software developer at arculus. His insights shed light on the diverse applications the language serves within arculus and the reason behind its adoption. Join us as we delve into the world of programming through the lens of Darshan's experiences and expertise.

A first look into Python

Whether you're a seasoned developer or a passionate tech enthusiast, the odds are that Python has left its mark on your digital journey. The language, first released by Guido van Rossum in 1991, is present in a huge variety of modern applications. In fact, research conducted by code hosting platform GitHub in 2022, found Python to be the 2nd most used language for four years in a row, with four million developers using it in 2022.

But what actually is Python?

Python was born from van Rossum’s desire to write a clean and aesthetically pleasing language. And if you're wondering how a programming language can have these qualities, check out a simple piece of code in both Java and Python:

Python

print("Hello world.")

Vs.

Java

public class HelloWorld {
    public static void main (String[]args) {
      System.out.println.("Hello world");
    }
}

The Python Software Foundation defines it as “an interpreted, interactive, object-oriented programming language”. Let’s break down what each of these characteristics means:

  • Interpreted: developers don't need to compile the code before running it. Instead, the Python interpreter reads and executes the code line by line, making development more flexible.
  • Interactive: developers can interact with the Python interpreter in real time. This interactive mode, often used in the Python shell (REPL - Read-Eval-Print Loop), enables them to enter and execute code snippets one at a time. It's useful for testing small code snippets, experimenting, and learning.
  • Object-oriented: Python follows the principles of object-oriented programming (OOP), where developers arrange code into objects or classes, each encapsulating data and behaviour. OOP promotes modularity, reusability, and a more organised approach to solving complex problems. Python allows the creation and use of objects, making it suitable for developing large and complex applications.

Why is Python so popular?

To better understand the popularity of Python and its crucial role in the arculus tech stack, we asked software engineer Darshan Patel to explain some of the language’s key advantages:

Rapid Prototyping

“Python is a dynamically typed language with ‘batteries included’. This means that it ships with a lot of functionality for performing various tasks, with less overhead compared to statically typed languages”, highlights Darshan. “It also offers the benefits of quickly implementing abstract ideas into something that is ‘almost tangible’, interactive and easily perceivable by everyone. These qualities allow us to quickly iterate over the product, gather feedback and reduce the time to market,” he continues.

Beginner-friendly

Darshan describes Python as having a “very gentle learning curve”. In other words, beginners and experienced programmers alike can easily learn the languages. “Its syntax is also very human friendly and close to natural language. This offers great readability and understandability concerning the existing code”, he explains.

Great community and learning tools

Along with Python’s numerous inbuilt functionalities comes a plethora of online/offline resources available to tackle all sorts of problems. “Resources like libraries, books, courses and tutorials are abundant and can be employed to tackle almost any problem. Furthermore, it has a lively, diverse and inclusive community of people who contribute to teaching, creating and maintaining the aforementioned resources. The community is also happy to help via channels like Forums, Q/A sites and even Discord Servers”, explains Darshan.

Expansive reach

“I would categorise Python as a ‘Jack of all trades’ among existing programming languages because it is ubiquitous within various technical/scientific fields”, defines Darshan. He explains that many disciplines and fields employ Python to solve all kinds of tasks. “This prevalence makes it one of the top choices, since problems from various fields can be tackled using the same language”, he concludes.

Darshan sitting in front of his computer. He is focused, loooking at two monitors.
Darshan focused on his work as a Python developer

Other Python benefits that stand out are:

  • It’s open source: Python’s source code is freely available for anyone to view, use, modify, and distribute.
  • It’s portable: Python code can run on different platforms without significant modifications, ensuring broad application compatibility.
  • It’s extendable: Developers can enhance Python's functionality by adding external libraries and modules.

Python’s libraries

Libraries are “cornerstones of modern software development. They offer pre-built solutions to a variety of problems which can be directly incorporated into the application, rather than writing the solution by hand”, defines Darshan. “Functions like file operations, network communication, Data Structures and Algorithms are commonly used over a wide range of applications. And libraries offer the means to implement such functions with minimal effort. This ultimately reduces the time required to implement the application”, he concludes.

Although most programming languages offer their sets of libraries, Python shines on two fronts here:

  1. Python’s standard (or internal) library comes with an extensive collection of built-in modules and packages that provide a wide range of functionality right out of the box. “On the other hand, languages like C or Rust are shipped with a more conservative amount of internal libraries. So, projects in these languages tend to rely on a high number of external libraries.”
  2. Python’s strong community also ensures that the language boasts one of the most extensive ecosystems of third-party libraries and packages among programming languages. They cover virtually every domain, from web development and data science to machine learning, artificial intelligence, and scientific computing. Some prominent examples include:

  • Numpy: Offers high-performance data structures for performing computations.
  • Matplotlib: Offers means to visualise and analyse data.
  • Qt: Provides GUI (Graphical User Interface) frameworks
  • Networkx: Offers data structures and algorithms for network analysis.
A monitor showing a long snippet of Python code

The not-so-bright side of Python

Despite its many benefits, working with Python doesn’t come without challenges. For Darshan, there are three main disadvantages associated with programming in Python. Here is a closer look:

  1. Limited Performance: "One of the primary challenges of using Python is its limited performance. Being a dynamically typed language, the interpreter has to perform 'checks and balances' while the code is being executed," defines Darshan. These checks and balances lead to overhead during program execution, which can hinder performance.
  2. Concurrency and Multithreading: Darshan also highlights an issue related to modern computer hardware, which often includes multiple processing units known as cores. He explains, "Modern systems have several cores. Python, however, by default, doesn't efficiently use them due to certain technical constraints in how Python code runs." This means that Python programs may only fully benefit from the extra computing power available in multi-core computers if developers specifically design their programs to do so, which can be a complex task.
  3. Type Safety Challenges: Python's dynamic nature means it doesn't provide inherent type safety by default. “As a program becomes larger and more complex, ensuring the consistent use of the right data types across various parts of the application, can become increasingly challenging," points out Darshan. However, modern Integrated Development Environments (IDEs) and code editors include type checkers that promptly alert developers to potential type-related issues. Additionally, external libraries are available that perform static type analysis, proactively checking the codebase for any type misuse.

Python in the real world

Despite its challenges, Python is still one of the most extensively used programming languages across multiple use cases. It serves as a go-to language for data analysis and machine learning, enabling professionals to conduct complex statistical analyses, create data visualisations, and build machine learning models. In web development, Python powers the backend infrastructure, managing data exchange, database interactions, and security. It excels in automation and scripting, allowing users to streamline repetitive tasks and processes efficiently. It also contributes significantly to software development, aiding in build control, bug tracking, and automated testing tasks.

Python as a part of arculus’ tech stack

Python has also been crucial to the arculus tech stack since the company started developing its fleet management software. Darshan explains the reason:

"The programming language selection is mainly done by considering the problem at hand and opting for the best-suited language. For applications that require high performance and efficiency, languages like C, C++, and Rust might be good candidates. Suppose the application focuses on scientific domain problems like Machine Learning, Artificial Intelligence, and Data Science. In that case, Python is a good candidate due to its popularity and the vast amount of existing libraries and applications for said domains."

As the arculus solution portfolio involves a mix of domains, use cases, and scopes, our tech stack is also a complex blend of different languages. “Factors like performance, efficiency, problem domain, time frame, and deployment platform played a vital role in crafting our tech stack,” clarifies Darshan.

So, where exactly do we use Python?

Python and Rust are the two main forces behind our fleet manager. “We use Rust for its safety, efficiency and performance, so that we can coordinate a large number of robots safely and efficiently. At the same time, Python helps us build tools, algorithms and extensions quickly and with ease. It also helps us perform data analysis on our systems for identifying bottlenecks and evaluating performance and behaviour characteristics to serve our customers better”, reveals Darshan.

A close up of a monitor showing a close up of a code written in Python.
A code snippet in Python from the arculus fleet management system

Further languages in the arculus tech stack include C++, Javascript and Typescript. “The software running on the arculees, which allows them to efficiently plan paths within a given environment, is primarily written in C++, whereas Javascript and Typescript are used to build our end-user interfaces, which allow the users to interact with the robots and fleet management system,” he concludes.

TLDR.py

In summary, Python is a versatile and widely embraced programming language. It is exemplified by its rapid prototyping, user-friendly nature, robust community, and diverse applications. However, it comes with inherent limitations, including performance constraints and type safety challenges. Darshan Patel's insights from his experience at arculus, highlight Python's crucial role in the company's tech stack. Despite its challenges, Python remains a powerful tool in the arsenal of developers worldwide, shaping the landscape of software development across various domains.

Featured Image
Autonomous Mobile Robots (AMRs) can locate and navigate themselves in an environment—this is how they accomplish their tasks of assembly and transportation. But how do they know where they are and where they need …
December 11, 2024
Featured Image
At arculus, innovation and efficiency are the most critical factors when devising solutions. This commitment is adhered to at every stage of our Autonomous Mobile Robots (AMRs) production cycle—from prototyping and defining the different …
September 10, 2024
Featured Image
When developing a new Autonomous Mobile Robot (AMR) for intralogistics, deriving key lessons from the real-world use cases from the very beginning of the journey is crucial. This is what arculus did with arculee …
July 15, 2024
CONTACT

arculus GmbH
Balanstrasse 73 
Haus 10
D-81541 München

info@arculus.de