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 0:00

shit i dunno what happened

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 0:08

>>1
python doesn't automatically have readable code because you have to indent it.

Name: Anonymous 2015-02-08 0:26

looks the same to me

Name: Anonymous 2015-02-08 2:16

>>3
Python has inherently more readable code because you have to indent it properly.

Name: Anonymous 2015-02-08 2:16

JACKSON 5 GET

Name: Anonymous 2015-02-08 3:20

Even if it didn't force me to use Guido's formatting style, it still has plenty of problems that make it a terrible language useful only as a toy.

Name: Anonymous 2015-02-08 4:46

Any programmer, even a new programmer, can format their code without being forced to.
It's also amusing how you forgot to use [code] tags and ended up with unformatted code anyways

Name: Anonymous 2015-02-08 5:27

8 words: the forced indentation of code

Name: Anonymous 2015-02-08 7:17

>>6 Oh snap!

Name: Anonymous 2015-02-08 8:31

Lambda fibs are quite lovely with python's one-line lambda syntax.

print ((lambda f: (lambda x: x(x))(lambda y: f(lambda a: lambda b: y(y)(a)(b))))(lambda f: lambda s: lambda i: (lambda pr: pr(lambda a: lambda d: a))(s) if i == 0 else f((lambda s: (lambda p: p(lambda a: lambda d: d))(s)())(s))(i-1)))((lambda f: (lambda x: x(x))(lambda y: f(lambda a: lambda b: y(y)(a)(b))))(lambda f: lambda a: lambda b: (lambda a: lambda d: lambda f: f(a)(d))(a)(lambda : f(b)(a+b)))(0)(1))

try calling it with a number :-)

Name: Anonymous 2015-02-08 10:32

>>11
No motherfucker, why would I call a fibs function with a number? Don't be a stupid.
Plus can you get that on more than one line so it doesn't fall off my screen? No fucko, I didn't think so! ``One-line lambda'' is more of a limitation than a feature!

Name: Anonymous 2015-02-08 12:27

Any programmer, even a new programmer, can format his code without being forced to.
It's also amusing how you forgot to use [code] tags and ended up with unformatted code anyways

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.

Name: Anonymous 2015-02-08 13:43

>>14

Jewish Quality©

Name: Anonymous 2015-02-08 15:28

Well, in some logarithms , an interface is going to be internal to the system, but an abstract class has terminators that make it external

Name: Anonymous 2015-02-08 16:38

>>14
Lambda is my favorite Greek letter to write. Everyday, I write the Greek alphabet five times when I wake up, and doing the final curve strokes on λ (the unicode doens't do it justice) just makes me feel so satisfied.

And since I know somebody is bound to ask, my least favorite Greek letter would probably be either xi or zeta.

Name: Anonymous 2015-02-08 18:01

>>17
But it has nothing to do with anonymous functions.

Name: Anonymous 2015-02-08 18:09

>>18
But it's pretty and fun to write.

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