Hacker News new | past | comments | ask | show | jobs | submit login

Quite often in Rust, the way to make it easier is to go one step back: instead of thinking about how to make a tree right, you might want to think about why you want a tree in the first place. Sometimes it's the right thing to do, sometimes there is another approach that fits Rust's paradigm better.

Speaking of paradigms, although Rust definitely looks "imperative", the ownership system makes it bloody different. Try to implement a tree "as in C" using Haskell or Prolog and you will lose time and energy for a result that does not use the language to its fullest.




> instead of thinking about how to make a tree right, you might want to think about why you want a tree in the first place.

Sure. But that's true for every programming languages, at least in my experience.

Anyway, someone, somewhere will actually want/need that tree. And they'll run into the aforementioned problems.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: