Programming

9 thoughts
last posted July 1, 2015, 3:08 p.m.

7 later thoughts

0

The first time I saw variable and return types on the right side after a colon was in ActionScript. This was beautiful.

function repeatString(string:String, 
                      numTimes:uint):String 
{
    var output:String = "";
    for(var i:uint = 0; i < numTimes; i++) 
    {
        output += string;
    }
    return output;
}

Now a lot of very nice modern programming languages use this convention: TypeScript, Scala, Kotlin, Rust, Swift.

1 earlier thought