Understanding the benefits of Rust

C++20
Rust, with its guarantee of memory safety, marks its place as a promising programming language. If you’re wondering whether you should invest your time in Rust, computer programming enthusiast Kris van Rens has a highly focused training for you at High Tech Institute.

Rust, an emerging programming language, has started garnering attention among many companies due to its promise of guaranteed memory safety. Of course, there have been novel programming languages before, and the choice to adopt a new one is always a significant decision. If you’re wondering whether Rust could be a useful addition to your software development operations, computer programming enthusiast Kris van Rens has prepared a training for you, “Exploring Rust,” organized by High Tech Institute.

Van Rens likens Rust’s memory safety to guard rails: “It prevents software engineers from shooting themselves in the foot. Essentially, you trade freedom for guaranteed safety and predictable behavior.” Simultaneously, he considers Rust’s expressive syntax as one of its strong suits, making it an attractive language to work with. A third benefit he highlights is the compiler: “It’s a great programming companion, delivering excellent error messages. It also frequently offers suggestions for fixes, literally ‘guiding’ you as you go.”

Production-ready

As Rust is a relatively young programming language, it’s natural to question whether it’s ready for production. According to Van Rens, the answer depends on the application domain, but generally speaking, he would answer with a strong yes. “In fact, many renowned high-tech software engineering companies use Rust in production, for example in application, cloud and web development.”

In more constrained areas like embedded development, full support isn’t always guaranteed, partly because this depends on the support by the manufacturer of the embedded device. Domains like automotive and aeronautics requiring software certification trajectories may also be challenging with Rust at the moment. However, Van Rens indicates, “the German company Ferrous Systems already offers a Rust toolchain that’s ready for use in environments that require an automotive ISO 26262 certification. Efforts toward other requirement levels are underway. It’s just a matter of time.”

''My goal isn’t to deliver Rust experts but to provide participants with a comprehensive understanding of what makes the language different.''

Distinct concepts

Van Rens doesn’t consider Rust harder to learn than advanced C or C++. “Yes, C might be a small language, but mastering C or C++ takes many years of focused work and discipline. Perhaps the learning curve for Rust is steeper in the beginning as the language in itself is larger, but in the long run, it doesn’t make a difference. I often come across software engineering companies publishing articles about their successful Rust adoption, explaining that the language wasn’t particularly hard to learn.”

Part of Rust’s steep learning curve is due to some unique concepts that aren’t found in traditional programming languages like C and C++. In his training, Van Rens focuses on these elements, expecting participants to be software engineers with systems development experience. “This enables me to introduce Rust at an advanced, thorough level. My goal isn’t to deliver Rust experts but to provide participants with a comprehensive understanding of what makes the language different. This assists them in determining whether they should invest their time in Rust and facilitates a successful adoption of the language if they decide to give it a go.”

Because of its focused approach, the “Exploring Rust” training is spread over only two half days, within a two-week time frame. “I immediately jump in at a high level and cover the most important topics in-depth. I spend about 30 percent of the time on hands-on exercises. For those eager to delve even deeper, there are a couple of larger homework exercises.”

This article is written by Koen Vervloesem, freelancer for Bits&Chips.

A deep dive in C++20

C++20
C++ has evolved a lot over time. Software engineers who are still using outdated paradigms of the programming language don’t realize its potential to the fullest. In his “C++ fundamentals” training at High Tech Institute, computer programming enthusiast Kris van Rens introduces C++20, including topics like templates and ranges.

Over the years, many programming languages have been proposed as alternatives to C++. Nevertheless, this hasn’t made C++ any less relevant, computer programming enthusiast Kris van Rens insists. “There are millions of lines of C++ code in production, and a substantial number of engineers in the industry are trained in the popular programming language.”

One of the challenges of mastering C++ is the sheer size of the language, Van Rens notes. “C++ is an old language and it has become quite vast and relatively complex due to the multitude of new features that it has received over time. As a result, many C++ developers have built up their language knowledge in fragments, without a clear, comprehensive view.”

Van Rens aims to offer this comprehensive view on the programming language in his 4-day training course “C++ fundamentals,” organized by High Tech Institute. In this training, he introduces the fundamentals of modern C++ to software engineers of all levels, whether it’s their first contact with the programming language or whether they want to update their knowledge of older C++ versions.

''Many books and online resources are still teaching older versions of C++, thereby restricting you from realizing the language’s potential to the fullest.''

A living language

As C++ and its tooling have changed a lot over time, it’s easy to get stuck learning outdated paradigms. Van Rens cautions: “Many books and online resources are still teaching older versions of C++, thereby restricting you from realizing the language’s potential to the fullest.” C++ as a language is still very much alive, with new versions appearing every three years, and major feature updates at least every six years. “It’s up to software engineers and their employers to keep up-to-date with the language changes and benefit from the new features,” Van Rens opines.

Van Rens covers C++20 in his training, including powerful topics like templates and ranges. “This C++ version from 2020 is fully supported by most of the latest toolchains, and in industrial production environments, its adoption is relatively new. Maybe some participants of the training might not be able to apply C++20 directly in their environment. However, they’ll be able to identify the potential improvements and changes that C++20 will bring to their code. This way, they’ll hopefully be able to contribute to a future migration to newer C++ versions in their company. During the training, I also highlight the features of C++20 that were absent in earlier versions of the language.”

The “C++ fundamentals” training spans over four days in total, divided into two blocks of two full days, with a week’s break in between. “I cover the basic elements of the language in the first two days, followed by a more in-depth dive during the next days. The focus is on building a solid foundational knowledge of C++, and on knowing where to find sources for further professional development in C++,” Van Rens summarizes the training. He spends about half of the training duration on in-class exercises, all derived from his practical experience as a seasoned C++ software engineer. For those eager to delve even deeper, there are a couple of larger homework exercises.

''Perhaps in the distant future, C++ might evolve to accommodate strict safety requirements, but not at this moment. However, using the right discipline, guidelines and tools, working with C++ can be mostly safe.''

Software safety and security

A new theme in the domain of programming languages is the shift to stricter regulations around software safety and security. This will influence every field of software development, Van Rens emphasizes. “Software engineers will likely have to provide more assurances about safety and security.” The two main approaches for this are the use of a memory-safe programming language like Rust or the use of a language with garbage collection to eliminate manual memory management.

Although C++ isn’t a strictly safe programming language, Van Rens attests that C++ code still has its place in the application landscape. “Perhaps in the distant future, C++ might evolve to accommodate strict safety requirements, but not at this moment. However, using the right discipline, guidelines and tools, working with C++ can be mostly safe. This comes without hard guarantees, yet it might be ‘safe enough’ for your purposes.”

This article is written by Koen Vervloesem, freelancer for Bits&Chips.