3 Trends in Emerging Programming Languages
Tags: watercooler, programming
Published: 2021-03-11 20:21:32

As a professional in the software field, it is important to stay up-to-date on trends and changes in the field. Here are a few trends that I've noticed in languages lately. The examples I will present use emerging languages which I imagine will become more prominent in the near future.

## Type Inference

Type inference has existed in languages for a while. Lately, it seems to be gaining prominence. Even conservatives languages (Java) are adopting 
[type inference](https://www.codejava.net/java-core/the-java-language/var-keyword-in-java). Type inference in languages typically begin with `var` or `let`.

Typescript:
```typescript
let myVar = "something"
```

Kotlin
```kotlin
var myVar = "something"
```

Go
```go
var myVar := "something"
```

The idea with the `var` or `let` keyword in these languages is to save extra keystrokes and allow the compiler to infer the type based on the assignment as opposed to the traditional example:

```java
String myString = "something";
```

## Disappearance of Classes

The title of this section is misleading. When I refer to disappearance of classes, I mean disappearance of classes in the classic C#/Java stance. Getters and Setters are starting to be considered redundant and verbose.

```java
public class MyClass {
  private String field1
  public getField1() { return this.field1; }
  public setField1(String field1) { this.field1 = field1; }
}
```

Class objects are being restructured such that the properties look more like a struct. In some cases (Kotlin), the getter/setter logic are inferred by the compiler and generated behind-the-scenes

Go
```go
type myStruct struct {
  field1: string
}
```

Kotlin
```kotlin
class myClass {
  var field1: String
}
```

Typescript
```typescript
class myClass {
  field1: String
}
```

> ⚠ There are some libraries which can make Java less painful in this regard such as [Lombok](https://projectlombok.org/)

## Shifting of Types to the Right

In traditional languages, when declaring a variable, the expression typically resembles the form:

```
<Type> <Symbol> <Operator> <Operand>
```


A pattern with these emerging languages is that [types are moving to the right](https://elizarov.medium.com/types-are-moving-to-the-right-22c0ef31dd4a):

```
<Symbol>: <Type> <Operator> <Operand>
```

```java
List<String> myList = new ArrayList<String>();
```

Here are a couple of examples:

Declaring a variable:

Go
```go
var library: Book[]
```

Kotlin
```kotlin
fun sendMessage(message: String): boolean {...}
```

# Why This Matters

Although mature established languages (i.e. C#, Java, C\C++) and the bodies that maintain them are contributing their best efforts to pursue some of the latest trends in programming language patterns, there may be a chance that future developers are not educated in more traditional development practices. One example is the prevalence of coding schools which only teach Javascript/Typescript. As a developer it's important to mentor junior developers as well as non technical personnel. Part of that mentorship involves being aware of the changes in languages in order to communicate more effectively with these audiences.

Additionally, there may be better ways to structure syntax with these new patterns which weren't previously available under more traditional pardigms.

# Other Thoughts/Discussion

Have you noticed any programming language trends that aren't covered in this article?

Are there things you see being taught today that wouldn't be considered traditional (i.e. Functional/Reactive over OOP)?