A reference guide to some of the weird and wonderful features of programming languages, demonstrated via unit tests. Some are created from experience, most have been found from research, but all are adapted to be as simple to understand as possible.
Install and run with Just:
just goRelative to other languages I have used, C++ easily throws up the most WTFs, mainly due to its sheer size and backwards-compatibility with C. The majority of the features here have been learnt from working with existing code, but many have been adapted from the following aggregate resources:
- Evan Wallace: Obscure C++ Features
- Stack Overflow: Hidden Features of C++?
- Stack Overflow: What are some of the more obscure parts of C++?
As ever, Wikipedia has been invaluable when looking for detailed descriptions of each feature, and often throws up more interesting lessons in the process!
- DamienG: 8 things you probably didn't know about C#
- Simple Talk: Giving Clarity to LINQ Queries by Extending Expressions
- Stack Overflow: Hidden Features of C#?
- Toptal: [25 Essential Questions Asked in Top JavaScript Interviews]
All the examples are from personal experience with the language and existing scripts. The documentation from the Perl site and CPAN modules often provide excellent explanations and usage instructions.
My initial interest in learning Python quickly turned into a love of the language, thanks to the original Python Tutorial by Guido van Rossum, the author of the language. Most of the examples here are inspired by the those in that tutorial, although it has since been updated for every new release, and is particularly different for version 3 of the language.
- The Rust Reference: The Rust Reference
- Rust by Example: Rust by Example
- Stack Overflow: What are Rust's exact auto-dereferencing rules?