Grafvision - Fotolia
Choose the best programming language for DevOps workflows
DevOps is a rapidly evolving set of technologies and practices; choosing the right programming language -- or languages -- makes a big difference in terms of functionality, efficiency and speed.
DevOps teams can choose from many available programming languages. All languages have both strengths and weaknesses -- some inherent to the language itself, and others dependent on a given application or context in which the language is used.
To evaluate programming languages for DevOps, consider factors such as developer experience and familiarity, speed of development and flexibility.
DevOps programming languages: Some basics
DevOps explores the intersection between software development and traditional IT operations. While developers work most closely with programming languages, IT ops admins and DevOps engineers still need some level of familiarity with the languages used in their organizations to, for example, handle integrations and develop scripts.
There are some general tradeoffs to consider when choosing a programming language. For example, many IT operations admins use scripted or interpreted languages, as they enable rapid development. Compared to compiled languages, however, interpreted languages have a slower execution speed.
In addition, some programming languages are statically typed, while others are dynamically typed. Statically typed languages check data types for errors at compile time -- which results in fewer errors at runtime; dynamically typed languages don't check for errors until runtime. Statically typed languages also require DevOps teams to define variables before use -- something dynamic typing does not require.
In this article, we will look at some of the most common programming languages -- both compiled and interpreted, as well as statically typed and dynamically typed -- and their relative pros and cons for use in a DevOps environment. These languages include Go, Python, Scala, Ruby, C and C++.
A relative newcomer to the scene, Google's Go language -- sometimes called Golang -- has risen in popularity for a number of reasons. Within a DevOps workflow, there are two particularly appealing items about Go: execution speed and a single, cross-platform executable. Teams can slot one properly delivered executable into any process within the DevOps workflow, without worrying about dependency management, as all dependencies are built into the executable at compile time.
One disadvantage is that Go is a compiled program and must deploy as a binary executable, unlike interpreted languages, where the code itself runs directly within the process for quick iterations.
Unlike Go, Python has been around for a very long time. Python is an interpreted language, which means it is evaluated at runtime, but it supports quick development speeds -- a notable advantage in a fast-moving DevOps environment. Additionally, Python is very flexible, as it's a dynamically typed language; this enables it to interface with a variety of other tools within a DevOps workflow.
However, because it's an interpreted language, Python has a more complicated prerequisite setup and slower execution speed. The nature of dynamic typing can also introduce runtime errors more easily.
Because of its similarities to Java, Scala offers a shorter learning curve for many Java developers. For highly scalable systems that have high concurrency needs, Scala also offers built-in support and efficiencies.
Scala's downside is that it has a smaller community compared to some other languages on this list, which means developer familiarity is low. Additionally, Scala runs in the Java Virtual Machine (JVM), which introduces more complexity and upkeep than other languages. Unless concurrency and scalability are top requirements, Scala might not be the right programming language for DevOps tasks.
The biggest advantage of Ruby -- another interpreted language -- is its simplicity, as well as the industry's diverse support for Ruby Gems, or modules. Ruby's simplicity enables the rapid development and implementation of necessary scripts for DevOps processes.
Ruby, however, often has a slower execution speed, not only in terms of general performance, but also for boot speed in certain circumstances. Finally, if an IT organization uses Ruby for database access, its tight Active Record coupling means that admins might lose necessary flexibility, depending on the requirements.
C and C++
Both the C and C++ languages have a long and storied history. Powerful and developed extensively, these languages offer unparalleled capability across a variety of OSes. Execution speed and low-level access are among the most desirable features. C is a classic low-level procedural language, while C++ is a superset of C that offers object-oriented features on top.
Disadvantages include the languages' complexity, need for manual memory management, longer build times and the challenge to configure compilers correctly for the organization's needs.
Consider a mix of languages
There are many different programming languages for DevOps workflows -- this article merely scratches the surface. And teams are not limited to only one language; sometimes, a mix of languages might best meet their needs.
However, the downside of multiple programming languages is that the pool of knowledgeable developers becomes more limited, and the breadth of experience diminished. To use multiple languages efficiently, limit how many -- and consider how they interact to avoid potential conflicts and development or execution issues.