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

Thinking in Lisp

Name: Anonymous 2012-02-04 20:31

SQL, Lisp, and Haskell are the only programming languages that I've seen where one spends more time thinking than typing.
That's because it takes forever to think of the solution in Lisp and Haskell as opposed to a decent language. Faggot lispers will spend most of their time figuring out how best to abuse recursion because they think it makes them leet programmers or some shit.

Name: Anonymous 2012-02-06 5:14

>>48
why is it awful?

and for converting it, I guess this could work:

int f(int n) {
  int a = g(...);
  if(n < 3) a = h(...); // Note the wasted computation of g.
  ...code using a...
}
-->>
int f(int n) {
  int a = g(...);
  if(n < 3) {
     int a2 = f(...); // g is still wasted, but at least is looks ugly, encouraging you to write it like the following instead:
     ...duplicated code to use a2 instead...
  } else {
    ...code using a...
  }
}
// do this bro:
int f(int n) {
  int a;
  if(n < 3) {
    a = f(...);
  } else {
    a = g(...);
  }
  ...code using a...
}

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