Hacker News new | ask | show | jobs
by brlewis 856 days ago
With Rust do you close all your } manually? Do you have an example of Rust code where the equivalent Lisp code would be harder to parse, assuming equal familiarity with both languages?
2 comments

> With Rust do you close all your } manually?

You don't have to, because you don't end up with }}}}}}}}} in Rust, because statements end with ; and not }.

I didn't end up with ))))))))) in Scheme because it was easy to create smaller functions. I do see rust ending with

      }
    }
  }
In TypeScript I'll often find myself ending blocks of code with

        });
      }
    });
  }
I'm having fun with TS, but I do miss the parentheses. They were simpler.
1. Lots of small functions lead to code in which bugs often hide in plain sight, see this old memo by John Carmack: http://number-none.com/blow/john_carmack_on_inlined_code.htm...

2. Scheme is better than Common Lisp when it comes to Lots of Irritating Superfluous Parenthesis, since declaring a variable in Scheme (using 'define') doesn't create a new nesting like it does in Common Lisp (using 'let').

I do, but there are about 4x fewer }'s in Rust than there are )'s in Lisp.

Look at these:

https://rosettacode.org/wiki/Archimedean_spiral#Common_Lisp

https://rosettacode.org/wiki/Archimedean_spiral#Rust