News for hackers. Stuff that matters.
Re:argp: GNU-style command line argument parser for Go by cedws on Monday March 24, 2025 @07:24AM (#43459666)
Reflection is slow and bug prone. Struct tags are widely considered in the Go community to be a nasty hack yet a necessary evil. They should be used at little as possible because if you mess them up you don't get a compile error, you get a runtime error.
Re:argp: GNU-style command line argument parser for Go by 9rx on Monday March 24, 2025 @12:05PM (#43462592)
> Reflection is slow

Beware of microbenchmarks, but in my tests the above package only added around 0.001 ms over the standard library flag package. Even if real world usage increases that by several orders of magnitude, it isn't going to matter. No human will ever notice.