133

Ten interesting features from various modern languages

 6 years ago
source link: https://medium.com/@kasperpeulen/10-features-from-various-modern-languages-that-i-would-like-to-see-in-any-programming-language-f2a4a8ee6727
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
1*MBSFZuKkSjDQO8flZY4jow.png
Pattern matching in Kotlin

Ten interesting features from various modern languages

Lately I have been studying some modern languages, such as Reason, Swift, Kotlin and Dart. I got excited by many of the features they offer. Many of those features I had never read or heard of before. Today, I want to share with you the 10 features that I found most interesting.

I hope that in the coming years, features like these will become more widely adopted, also in older languages, such as Javascript, PHP, Java and Python. As many of us programmers have to work with those languages every day at work, I would love it if also those languages keep evolving.

Click on any of the Read more… links below to go to the documentation of the language. Often there is some playground that you can immediately start hacking with!

#1 Pipeline operator

I couldn’t find any official documentation from Reason, but it seems to work similar as this ECMAScript proposal. You can try it out in a playground here.

#2 Pattern matching

Read more…

Read more…

#3 Reactive (Rx) programming build in the language

Read more…

#4 Implicit name (using “it”) of a single parameter in a lambda function

Read more…

#5 Destructuring

Read more…

#6 Cascade operator

Read more…

#7 If expressions

Read more…

#8 Try expressions

Read more…

#9 Automatic currying

Read more…

#10 Method extensions

Read more…

I hope you have learned something new. Happy coding :)

Update: All the examples above are from Reason, Swift, Kotlin and Dart. However, many of the ideas above can already be found in much older languages such as Lisp (1958), Smalltalk (1972), Objective-C (1984), Haskell (1990), OCaml (1996) and many more. So while the examples are from “modern” languages, the ideas in this article are actually very “old”. (*)

You could say that those “modern” languages try to popularise old ideas. They put the idea in a different more common syntax while also leveraging older ecosystems. All the languages in this article use the popular C-style syntax. For example, Reason is OCaml in a C-style/Javascript-style syntax while also leveraging the JavaScript and OCaml ecosystem and Dart is heavily influenced by Smalltalk and leverages the Javascript ecosystem.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK