Top Programming Languages For Network Engineers

Network engineering and administration used to not need much programming skill. All you needed to know was how to run commands on switches and routers and how to configure networking devices. These days a network engineer has to know how to write code. Otherwise he or she risks becoming outdated and useless in their job. Networking is simply advancing too quickly for you to not know how to code. There are certain programming languages that are a better choice to learn if you are a network engineer. Read on to see which programming languages are the best choice for a network professional.

Networking Is Changing

Network engineers used to have to understand networking and networking gear. Things like the OSI layer model, TCP/IP, etc. along with Cisco IOS commands would be enough to get a job in the networking field. That is no longer true, and the jobs that require nothing but the above are becoming more rare.

Instead, a new approach is taking place where network professionals now must also know how to code. This approach is called Software Defined Networking (SDN). SDN is especially popular in datacenter environments. In its most simplest form, this approach creates a centralized controller that tells other networking devices how to forward their packets. This controller makes these decisions using the software it is running. In essence, it is this software that is telling the networking devices how to route traffic.

SDN revolved around the software, and knowing the programming language that the software is written in is key to getting a SDN job. You will want to write scripts that interact with the SDN software.

Even places that do not use SDN are going to want a network engineer who knows how to code. Writing scripts to automate daily tasks and common tasks is key to working more efficiently. This is true of most IT jobs, and especially true for system or network administrator. Networking jobs often involve repetitive tasks. If these tasks can be automated, then the network engineer has more time to work on something else. A company would rather hire one engineer who can automate the simple tasks than two engineers who are both wasting time doing repetitive tasks.

Best Language for Networking Professionals

There are a ton of programming languages out in the wild. Many are esoteric or uncommon, but even if you only think about the most common languages you will easily be able to list two dozen languages. Luckily, only some of these are going to be applicable to the networking field. There's a handful of scripting languages that are truly worth learning for a network engineer.

There are not many networking specific languages. But there are a number of programming languages that are more useful and more common in the networking field. This is due to a number of reasons, including the difficulty of the language, the compatibility of the language with networking software and the popularity of the language.

Python

Python is a general purpose language. This means it is not built for a specific field. Instead it is a good all around language used for many different things. This includes writing scripts and developing networking tools. It is also a great beginner language.

The first thing to know about Python is that it is extremely readable. This means that reading Python code is relatively simple and intuitive. This readability factor makes it one of the most popular beginner programming languages. Python is formatted in such a way that you will not have to spend hours trying to decrypt code just to understand what it does.

When I say that Python is a beginner programming language, I do not mean it is less powerful than other languages. Python is very powerful and can do just about anything you could ask a computer program to do. What I do mean is that Python is a common language chosen by coding beginners.

Code is important for modern network engineers, but coding is not necessarily going to be the main focus of a network engineer's job. A software developer can take the time needed to learn a difficult language such as C++. A network engineer does not have as much time to spend learning languages. This is why a language like Python is a great choice. It is powerful, but simple to learn.

Python is also becoming the default SDN language.

If you want to start learning Python a great beginner book is Python Crash Course. It will get you up and coding quickly. If you already have some software skills, then a networking specific book like Mastering Python Networking is going to be super helpful.

Golang

Go (AKA Golang) is a modern language developed by Google. Go was made to be intuitive enough that new engineers at Google could pick it up relatively quickly.

Go is a strongly typed language, which makes it a lot different from Python. This makes it similar to language such as C++. Developers who are familiar with C++ tend to really enjoy working in Go.

Go is especially powerful when it comes to creating network software. It is a great language for developing distributed systems, APIs and other network related software. One reason is that Go is great at concurrency. It is able to handle a bunch of things happening at once.

Go also goes hand in hand with protobufs (Protocol buffers). Protobufs are another Google invention. They are a way of transferring binary data between systems and then translating that data into human readable form. You can think of this as a more effective JSON.

Go has a bunch of powerful libraries, and is a super powerful and useful networking language. It is not used as much as Python though. At the same time, the jobs that are looking for Go developers tend to pay more than those looking for Python developers.

If you want to give Go a try, check out A Tour of Go or get a copy of The Go Programming Language.

Perl

Perl used to be the darling of system and network engineers. It is a powerful language that allows one to write scripts for automating tasks. The network engineers I currently work with all use Perl as their main scripting language. If you end up working with older code or older engineers, having a knowledge of Perl will be very handy.

Perl's biggest benefit is the huge amount of modules. A module is like a pre-written piece of code you can use within your code. Using a model that someone else wrote prevents you from reinventing the wheel. If someone already wrote code for the function you need, then you can just use their code. There is no need to recreate code that already exist. Perl does a great job of organizing these modules and making them accessible.

The problem with Perl is that it is no longer very popular. Python has largely replaced Perl as the language of choice for new network professionals. Python can do anything Perl can, but is also much easier to read. Perl generally has many different ways to perform a single action. Python generally has a single correct way of performing a single action.

Because of the multiple ways in which you can do the same thing, reading someone else's Perl code can be confusing. What if they do a thing in a completely different way than you are used to? You will spend time going through their code line by line trying to figure out what it is they are trying to accomplish.

Simply put, Perl is not as popular as it once was. If everyone at your job works in Python, you will likely also need to work in Python.

Bash

Bash is a language that comes with every Unix based system. It is a scripting language that is great for automating tasks. Python and Perl can do everything that bash can do, but bash scripts allow you to create very powerful tools by only learning a few commands (awk, sed, grep and egrep, wget, etc.) Bash scripts tend to be short and simple.

Bash is great if you need to automate things, but do not want to learn a whole programming language. If you need complex tools or want to learn advanced programming, Perl and Python are both better choices.

A great Bash book is Learning the bash Shell: Unix Shell Programming.

Languages A Network Engineer Should Avoid

There are other languages out there that can serve a network engineer in their role. Any general purpose language is a good choice. Especially those that are widely available on different Unix base systems. You don't want to have to install a whole language just to run a simple networking script.

JavaScript

JavaScript is a web developer language. Though NodeJS does allow running code on the backend, it is a poor language choice for a network engineer. NodeJS is not installed on most computers by default. It is not a language that many network engineers will know or use. It is also a bit different from many other programming languages (prototypical inheritance etc.) making it a bad language to learn as your first language.

JavaScript is single threaded, meaning that it can one run thread at a time. This is very limiting for networking software which is often trying to do many different things at once.

JavaScript is good if you want to build websites, not if you want to work in the networking field.

Java, C and C++

Both of these are good introductory programming languages because they will force you to be more verbose. A program written in Java or C is likely to longer and more explicit than one written in Python. This is because Python is a higher lever language that does some things for you automatically, while Java and C require you to do it verbose.

This is good for learning how to program in general, and these are good languages to learn in a computer science course or for someone who wants to do software development, but they are overkill for a network engineer. Learning a higher level language like Python will get you up and coding faster and more efficiently.

Generally, if you are interested in networking and are looking for a coding language, Python or Go is probably your best choice.

Unsure of where to start? Click here for a few good programming resources.