4 ms·
I'm sorry, but does anyone even glance at the source of these frameworks before they're upvoted?
by zalmoxes 10y ago
I'm sorry, but does anyone even glance at the source of these frameworks before they're upvoted?
- cyri 10y agoI've withdrawn my upvote after I saw this in the code: type Injector struct { values map[reflect.Type]interface{} customProviders map[reflect.Type]CustomProvideFunction }
- komali2 10y agoI don't understand, what's wrong with that? I've never used Go so I'm asking out of ignorance.
- CSDude 10y agoIt is not type safe and relies on runtime reflection based checks to make it work correctly, it can crash easily. However, I believe I made all the checks correctly and it should work as intended, but of course it is only 600 LOC, there can arise some issues.
- bigblind 10y agoComments like this could be extremely helpful to the author if you explain more clearly what you mean. Is it because they're using reflection so much? Or is it because a CustomProvideFunction could also be stored as interface{} or something completely different? I'm fairly new to Go as well, so I'm curious.
- khazhou 10y agoERROR 732: Intent unclear. Please elaborate to proceed with discussion. (refcode 567a8-732).
- alistproducer2 10y agoI've said the exact thing on multiple occasions. For example, https://news.ycombinator.com/item?id=12892550 https://news.ycombinator.com/item?id=12892550. this dude created something that opened a port and listened for commands that would control your OS. He hadn't spent 5 minutes making even some basic form of authentication and came straight to HN for the high 5's. People tried to flame me for pointing out that it seemed irresponsible to be promoting software in such a state.
- BoorishBears 10y agoThe current top comments all say what you said without the unwarranted snark.
- CSDude 10y agoUnfortunately, to achieve the functionality I described, I must have used reflection like that, which is not really nice, but I really prefer it to context based methods type assuming and casting which is essentially the same. I know people do not like reflection that is used like this, but the performance is not a concern, and I really got tired of transforming user input and checking for errors in each handler.
- ben_jones 10y agoI'll always advocate learning projects like this, but you're absolutely right that if anyone pulls it for production they deserve what they get. My personal litmus test for OSS is to read the test suite.
- adregan 10y agoPerhaps due to the fact that upvoting privately saves the story and doesn't forward you to another page as favoriting does (which isn't private), people are upvoting with the intention of browsing it later. I mention it because it is something I do frequently, and I do this because the favoriting feature isn't quite right (I want to privately save stories for later and I don't want to be redirected).