Currently Trending Programming Languages
Developers hate and love new programming languages. They have their favorites, which they’ve invested ages in learning and perfecting their skills, and they don’t like the thought of throwing it all away to learn something new. At the same time, they recognize serious flaws in those languages, and they’re sure it could be done better. They don’t lightly jump to a new language, but they will when they see enough of an advantage.
IEEE Spectrum’s list of the top programming languages of 2017 has one language climbing into the top ten for the first time and several fairly new ones gaining in popularity. Features like functional programming and error prevention show up in several of them. An old favorite is the surprising leader, though.
First made public in 2009, Go has become a fairly mature language. Its main niches are Internet applications and command-based software. It’s generally considered not so good for graphic front ends. Its watchwords are simplicity and speed. It compiles to native machine code.
Concurrency is a key feature. Go achieves it not with threads but with “goroutines.” Goroutines run cooperatively rather than preemptively, and they have lower memory requirements. At the same time, they require a bit more care to avoid deadlocks.
While many languages offer elaborate object-oriented features, Go is OO only in a restricted sense. There’s no type hierarchy. A type can implement any number of interfaces. It doesn’t do this by declaring them, but just by implementing all the methods that an interface specifies. The language is strongly typed but doesn’t use header files and keeps declaration boilerplate to a minimum.
Go code doesn’t throw exceptions. Its designers think they complicate code. Functions can have multi-valued returns, and the language defines an error type. Thus, a function can return a success or error code along with the value it calculates.
Many developers who are tired of language bloat and want fast compilation and execution find Go a good choice for many situations.
Scala and other JVM languages
The Java Virtual Machine (JVM) has spawned a family of languages that run under it. It’s an easy way to create cross-platform applications. Some of them go in their own directions, and some try to improve on Java’s flaws. None of them, except Java itself, made Spectrum’s top ten, but as a class they deserve a mention, and Scala holds a respectable fifteenth. It’s ninth on Stack Overflow’s survey of most loved programming languages for 2017. Kotlin didn’t even make the top 48 list, but as an approved language for Android development, it may eventually surpass Scala. Both of them are fully interoperable with Java, so developers can gradually wean themselves.
One of its best-known (and most intimidating) features is its powerful pattern matching. The match statement similar to Java’s switch mechanism but far more powerful. Matches can be not only on values but on types and structures. Cases don’t fall through as in Java, eliminating a common bug.
Unexpected null values are an even more common Java bug, Scala makes these less likely with the Option class and the None object. Variables can’t have null values; instead, a “nullable” object is an Option. It either wraps the desired value or is None.
Functional programming, treating functions as assignable data, is a hot trend. Java now allows it after a fashion, but it’s undeniably clumsy. Scala cleanly supports both functional and object-oriented programming.
Scala has a reputation as a difficult language to learn, but it has some clear advantages over Java. Perhaps eventually it or another JVM language will dethrone Java.
Low-level system code has to be extremely fast, so C and C++ have long been favorite languages for writing it. Unfortunately, their speed comes at the expense of safety. Pointers can point anywhere. String iterators can keep going past the end of the buffer. Deadly security flaws are sometimes the result. What’s needed is a language with the speed and flexibility of C and safety features that make those bugs rare.
Rust is the leading candidate for this role. System programming isn’t quantitatively as big as application coding, so it’s only number 22 in the Spectrum survey, but it’s at the top of the Stack Overflow best-loved list.
Pointers are dangerous. Rust eliminates most cases where they’d need to be used. The compiler does safety checks to prevent them from running wild. Sometimes, though, low-level code has to manipulate raw pointers. Developers can do this, but they have to mark the code with the unsafe keyword. That localizes the risk, and reviewers can pay special attention to those sections.
Null values are another danger. Rust avoids them with the Option type, which is extremely similar to Scala’s. It also has a pattern matching mechanism like Scala’s, and the two work nicely together for checking None values.
As development in Rust becomes more widespread, system flaws from buffer overflows and runaway pointers should become scarce. It’s no wonder it’s so popular among hard-core programming geeks.
Apple development used to be based on the rather clumsy Objective-C. Now the standard is Swift, which has grown tremendously in popularity since its appearance in 2014. It’s the one newcomer on the Spectrum list, and it’s fourth on the Stack Overflow list.
Like many other recent languages, Swift discourages the use of null values. It’s possible to give a variable the value nil, but only if the declaration explicitly allows it.
Header files aren’t needed in Swift, and boilerplate requirements are minimized. Constant and variable data are strongly distinguished for both named data items and classes.
Functional programming and closures are supported. Used properly, this allows more use of strictly local variables and constants, reducing yet another source of bugs.
Memory management is based on automatic reference counting. It’s more efficient than garbage collection and doesn’t cause hiccups in execution. It does require some care to avoid memory leaks.
While Swift’s first home was Apple development, it’s also available on Linux, and it’s gaining interest as a server-side language.
Surprisingly, the top-ranking language in the Spectrum list is an old one that doesn’t get that much attention. Python has actually increased in popularity in recent years. It holds a respectable sixth place in the Stack Overflow list.
It’s a versatile language, suited for short scripts as well as full applications. Partly because it’s easy to write and run short, self-contained snippets, it’s often the first language students use.
New languages take time to build a following, and older ones can stay popular for a long time. Keeping the right balance between familiarity and innovation is often tricky.
If you’re looking for software development that takes advantage of the latest advances, contact us for a no-pressure consultation.