News for hackers. Stuff that matters.
Re:Google: 90% of our engineers use the software you wrote (... by sgeisenh on Wednesday June 10, 2015 @07:22PM (#9696334)
If you instead use a language with algebraic datatypes, you can get a nice concise implementation. Let's try OCaml:

  type 'a tree =
    | Node of 'a tree * 'a * 'a tree
    | Leaf
  
  let rec reverse = function
    | Node (L, x, R) -> Node (reverse R, x, reverse L)
    | Leaf           -> Leaf
  
Isn't that nice? And it is even easy to reason about! Unfortunately, OCaml tends to chew up stack space so we're likely to seg fault, but that's okay!
Re:Google: 90% of our engineers use the software you wrote (... by peteretep on Wednesday June 10, 2015 @08:01PM (#9696510)
I was going to go with Haskell, which would have looked very similar, but thought I would struggle to reason at all about performance.