DEV Community

Discussion on: Go footguns: Go Defer and Rust Drop

Collapse
 
mainrs profile image
mainrs • Edited

These type of nuances that made programming feel more “convenient” (lack of a better word) were the reasons that drove me to focus on Rust instead of Go. I initially learned and focused on Go. But after I accidentally and luckily found Rust, I made the full switch.

The trait system and how its used to implement features like drop, operator overloading and the likes give developers really good foundations to write solid, easy to use, and hard to misuse libraries in Rust.

Sure, it sometimes takes some effort to make the compiler and its borrow checker happy. But I hadn’t had any issues with the borrow checker for the first year I programmed in rust. You’d be surprised as to how far you can go without having to put some time into it and understand it. The Blackbox concept can work wonders! :)

I came back to Go for one of my projects as I still think that Go is great for web servers. And I noticed that I have problems fully understanding how references and pointers work in Go. Returning a reference inside functions makes zero sense to me. I guess I just have to get used to the idea of a GC.