Which are your favorite programming language gadgets?
- by FerranB
There are some gadgets/features for programming languages that I like a lot because they save a lot of coding or simply because they are magical or nice.
Some of my favorites are:
C++ increment/decrement operator: my_array[++c];
C++ assign and sum or substract (...): a += b
C# yield return: yield return 1;
C# foreach: foreach (MyClass x in MyCollection)
PLSQL for loop: for c in (select col1, col2 from mytable)
PLSQL pipe row: for i in 1..x loop pipe row(i); end loop;
Python Array access operator: a[:1]
PLSQL ref cursors.
Which are yours?