Good point. I think knowing where to draw that line comes with experience (and having to fix lots of other people’s code).
Good point. I think knowing where to draw that line comes with experience (and having to fix lots of other people’s code).
I would have liked some comments explaining the rules we are trying to enforce or a link to the product requirements for it. Changing the rules requirements is the most likely reason this code will ever be looked at again. The easier you can make it for someone to change them the better. Another reason to need to touch the code is if the user model changes. I suppose we might also want a different password hash or to store the password separately even a different outcome if the validation fails. Or maybe have different ruled for different user types. When building a function like this I think less about “ideals” and more about why someone might need to change what I just did and how can I make it easier for them.
There are some monitoring tools which take a snapshot of the process table every few minutes. If you happen to run one of those, and your process happens to be running when the snapshots is taken you can catch it.
If this is a postgresql server and you have logging turned up with pids being logged, and the pin in question was a database process, you can probably find it in the database logs.
Gen AI is like super-autocorrector.
Most of the high visibility “tech bros” aren’t technical. They are finance bros who invest in tech.