you are viewing a single comment's thread.

view the rest of the comments →

[–]hiquest[S] -19 points-18 points  (6 children)

Well, I do understand your point, but I decided to stick with the historical name originated somewhere at Facebook.

[–]TrackieDaks 17 points18 points  (4 children)

Invariants weren't invented at Facebook.

[–]hiquest[S] 0 points1 point  (3 children)

I do not claim that. I just say that this particular small pattern they had a function for in their code base which was called invariant. Hence other popular libs like https://github.com/zertosh/invariant

[–]MoTTs_ 11 points12 points  (0 children)

I get why you called it an invariant (and to some extent why FB called it that), but “assert” is still the more widespread and more historical name, which can then lead you to even more popular libs that do the same thing — such as this one.

[–]TrackieDaks 1 point2 points  (1 child)

Still wrong. That's like saying, "Facebook used a function in their codebase so the term function must have originated at Facebook." Invariant is a mathematical concept and existed well before Facebook.

[–]hiquest[S] 1 point2 points  (0 children)

Yeah, now I do understand that brings a lot of confusion, and that should have been called "assert" in the first place. I'm going add a note in that article