4 Matching Annotations
- Jan 2023
-
-
I've worked with and have helped maintain paranoia for a while. I'm convinced it does the wrong thing for most cases. Paranoia and acts_as_paranoid both attempt to emulate deletes by setting a column and adding a default scope on the model. This requires some ActiveRecord hackery, and leads to some surprising and awkward behaviour.
-
- Aug 2021
-
-
Now consider we want to handle numbers in our known value set: const KNOWN_VALUES = Object.freeze(['a', 'b', 'c', 1, 2, 3]) function isKnownValue(input?: string | number) { return typeof(input) === 'string' && KNOWN_VALUES.includes(input) } Uh oh! This TypeScript compiles without errors, but it's not correct. Where as our original "naive" approach would have worked just fine. Why is that? Where is the breakdown here? It's because TypeScript's type system got in the way of the developer's initial intent. It caused us to change our code from what we intended to what it allowed. It was never the developer's intention to check that input was a string and a known value; the developer simply wanted to check whether input was a known value - but wasn't permitted to do so.
-
- Jan 2020
-
unix.stackexchange.com unix.stackexchange.com
-
You can but it's difficult. I recommend switching to a different tool.
-
- Dec 2019
-
github.com github.com
-
It shouldn't be useful to distinguish between requests made by Ajax and other kinds of request. Pretty much any usecase where you'd want to do that is better served by using the Accept header to ask for data in a specific format.
-