Hacker News new | past | comments | ask | show | jobs | submit login
Go Doesn't Need Generics (medium.com/meeusdylan)
2 points by Insanity on Dec 3, 2019 | hide | past | favorite | 1 comment



> When I first started learning Go, at some point I wanted to create a Stack-like data structure, so my initial reaction was to try to create a ‘generic’ solution. Because I envisioned my ‘stack’ ’being used in a variety of cases (in reality, this did not happen).

Correct. You don't need generics if you re-invent the wheel every time you need a data structure.

> Seeing value in simplicity does not make you a bad engineer. (Actually, if you believe complexity makes you a good engineer, try writing a webserver in brainfck).

Brainfck is extremely simple; it only has 8 commands. It is a perfect example of how sticking to a minimal set of language constructs makes programming harder, not easier.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: