3 ms·
I have written non-trivial code in Rust and Go. The thing about Rust is that it needs a bit of perseverance and experience of writing a bit of non-trivial code
by sudeepj 8y ago
I have written non-trivial code in Rust and Go. The thing about Rust is that it needs a bit of perseverance and experience of writing a bit of non-trivial code in Rust to really appreciate it. Writing tutorial like code won't cut it.
Life-cycle of a Rust developer: https://imgur.com/kNkV7jm https://imgur.com/kNkV7jm
Good, bad and the ugly: https://imgur.com/udNcZXa https://imgur.com/udNcZXa
With Go, in my head it is best explained in terms of the scene in the movie: Pursuit of Happyness
Boss: Chris. What would you say if a guy walked in for an interview, without a shirt on, and I hired him? What would you say?
Chris Gardner: He must have had on some really nice pants.
People (including me) find lot of issues with Go in terms of some choices in the language. But boy it does have some really nice pants and that is the ease of writing networking services + Go routines
- adventured 8y agoI recently started using Go for a bunch of small services a new product needed. I was amazed at how easy and fast it is to get up to a point of high productivity in Go. The language is really straight-forward to begin working in. Probably the most fun I've had learning a new tool in many years.
- deleted 8y ago[deleted]
- taneq 8y agoWhat does "error management story" refer to in the second pic?
- sudeepj 8y agoFor some time the dominant error handling way was 'error-chain' crate and the comment was made in that context. Now there is a failure crate https://github.com/withoutboats/failure https://github.com/withoutboats/failure. It is an improvement, but it still feels that one has to type a lot for something basic. Now, this is a matter of taste and many people will be ok with this.
- pcwalton 8y agoNote that if verbosity of error handling is a problem for you, you definitely should not use Go.
- sshine 8y ago> Good, bad and the ugly: https://imgur.com/udNcZXa https://imgur.com/udNcZXa What does "Development experience is very intense" mean?
- sudeepj 8y agoAn example: So suppose you have the following pseudo code: x = f() In other languages you start using 'x' straight away. You can call member functions on it, compare it, etc. In Rust if x happens to be of type Option or Result (which are wrapper types i.e. they wrap the value), then you need to understand these first very well to write idiomatic Rust code. These types have combinator functions like 'map', 'and', 'and_then', 'or', 'or_else', 'unwrap_else', etc. if unwrap() is not suitable for your use case. If you are coming from a non-functional language, one cannot help get a feeling that all you wanted was to use the value and you have to learn so much upfront. At the end of it you are mentally exhausted. My productivity increased a lot, once I realized that there is a pattern to these and knowledge gain with Option & Result is transferrable to using Future's combinators as well. It is very hard to explain it to someone as to how to get to this state. There lies the challenge with teaching Rust and I think Steve Klabnik and team has done really good job with documentation.
- steveklabnik 8y agoThank you!