Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

antipython fags: REKT

Name: Anonymous 2015-02-07 23:59

The formatting or appearance of code determines how quickly and easily the reader can understand what it does. A compiler will see no difference between this...

// Example 1: unformatted code.
public class Functions
{
public static int fibonacci(int n)
{
if (n < 2)
{
return 1;
}
return fibonacci(n-2) + fibonacci(n-1);
}

public static void main(String[] arguments)
{
for(int i=0;i<10;i++)
{
print(“Input value:”+i+” Output value:”+power(fibonacci(i), 2)+1);
}
}
}

...and this...

//Example 2: formatted code.

public class Functions
{
public static int fibonacci(int n)
{
if (n < 2)
{
return 1;
}
return fibonacci(n-2) + fibonacci(n-1);
}

public static void main(String[] arguments)
{
for (int i = 0; i < 10; i++)
{
print(“Input value:” + i +
” Output value:” +
power(fibonacci(i), 2) + 1);
}
}
}

...but the second example will be more easily understood by the reader.

Name: Anonymous 2015-02-08 12:35

>>11
What kind of shitty programming language would use a 6-letter reserved word for a lambda? It's not even meaningful, the word "lambda" is just the name of a Greek letter and has no connections to the concept of an anonymous function. So what's the point of writing it out every fucking time? Why not just use "lam" or ".\" or "fn" like the sane people who created ML did? Nooo, I want to write out 6 meaningless letters every time I want to define an anonymous function! Numbskulls.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List