3 ms·
You only lose type safety if you're writing generic containers. If you don't need a customStack or something similar you'll be fine. While I think it's good to
by dkuntz2 13y ago
You only lose type safety if you're writing generic containers. If you don't need a customStack or something similar you'll be fine.
While I think it's good to know how to write containers, and how they work, how frequently do you really need to write a custom container? What's wrong with the built in ones (provided they exist)?
- dilap 13y agoYes, didn't mean to imply you lose all static type safety -- you're still way better off on that front than in a language like Python or JavaScript. Basically, if you're happy with a dynamic language, Go makes things better most of the time, but sometimes you have fall back to dynamic checking, because of the lack of generics. Custom containers: Well, it's definitely true that you can get pretty far with just arrays and hash tables -- which Go special-cases! -- but you're probably gunna want something fancier eventually...