5 ms·
idk why everyone is treating this like it's some complicated mystery. it's defined to be consistent with universal quantification (ie, ∀x) that most of us shoul
by leetcrew 7y ago
idk why everyone is treating this like it's some complicated mystery. it's defined to be consistent with universal quantification (ie, ∀x) that most of us should have learned in intro to discrete. std::all_of works exactly the same way.
- capableweb 7y ago> most of us Who are "most of us"? People on HN? People who do programming? I've a professional programmer, but horrible at math. Don't have any formal education and even less education about discrete math. So for me this was educational and I thank the author for putting it down in writing and sharing the knowledge. I'm sure I'm not alone on HN or in the software industry with this. I'm also sure I'm sitting on bunch of knowledge you have no idea about, but when others share that, I don't shoot them down for it, I'm happy we're all helping each other understand things.
- jakearmitage 7y agoYou're not alone, don't worry with the gate keeping here.
- leetcrew 7y agothe article itself is a decent intro explanation. I'm mainly talking about all the comments in this thread getting into monoids and abstract algebra when a sufficient explanation can be found in first-year cs material. it's a consequence of how all_of and any_of relate to each other.
- capableweb 7y agoI see. Since you made a top-level comment, it seems you're commenting about the article itself. If you're replying to comments, I suggest you use the reply functionality and it all becomes a little bit clearer for everyone. I, for one, also like the comments here as they expand and dive into more topics that again, "some of us" have not read/heard about before so grateful for that.
- globular-toast 7y agoIt really just goes to show how far you can get without knowing the fundamentals these days.
- leetcrew 7y agoI really didn't mean this as a gatekeeping comment, but yes, you are right. I do think most programmers would benefit a lot from learning the fundamentals of logic, or at the very least boolean algebra. after seeing some of the tortured expressions they write, I certainly wish my coworkers were more familiar with boolean simplification rules and identities.
- globular-toast 7y agoI don't mean it as gatekeeping either. It's just an observation. Although I've clearly offended someone... I've lost count of the amount of times I've factored out the "not" from horrid expressions in my colleagues' code like "not this and not that" using Dr Morgan's law. Funny thing is I learnt Dr Morgan's in electronics a long time before I got to computers. I think the problem is it's "boring" and people get hooked on doing stuff with programming. I can't blame them. But I wish more people remembered the fundamentals.
- JadeNB 7y ago> idk why everyone is treating this like it's some complicated mystery. it's defined to be consistent with universal quantification (ie, ∀x) that most of us should have learned in intro to discrete. std::all_of works exactly the same way. Lewis Carroll didn't know this, and treated universally quantified statements over an empty domain as false. Of course that's wrong; but I think it's over-specialising to claim that this is something obvious, or that everyone knows. (Also, as others have said, if someone learns from this, then that's great! That's a positive impact, whereas saying "you should have known it already" is purely negative, so why bother?)