This makes sense if it's a type used to map an API ressource. You cannot be sure any of these are actually returned. You then assert they exists and trigger exceptions if not
Actually this makes perfect sense you don’t need anyone item specifically, you just need 1 item
null/undefined id sometimes is used for representing new users before sending them to the backend for creating. Sometimes null/undefined has different meanings ‘cause of team members not communicating well or rushing for deadlines.
even names are so complicated that it’s barely worth it to have separate firstname and lastname fields anymore
If email is a unique value b/c they don't allow multiple registrations under the same email, that is fine as a primary key (in which case it should not be NULL though). ID would then be used for example as foreign key to prevent information disclosure - say they send their user through an external survey which redirects back to their site, they use the ID to identify the user. But if the user never does any of these things, they don't need any further ID.
This is best reel ever made
Beautiful figure of speech, worthy of most noble scribe. 😄
We have in production the user which can hold a username, a company name, a lastname and a firstname. the username gets generated if a profile is added by automation (dont ask, yes this happens). There is no e-mail btw. Then the name can either be placed in first and lastname, firstname, lastname, company or all three or just one... you get it. So yeah. Is it the firstname? Maybe! Lastname? I dont know! Searching for users by name? Just do it. I love it
I've done this in backend situations. The first thing you do with such an object (called something like CreateUserCommand) is parse it into a proper User type where the fields are not nullable. If this fails along the way you return a validation error to the user.
I actually work with someone who tries to go by their first name only. It actually worked for some government offices in Germany but the tax system wasn’t having it.
As a Data consultant, I had a client that vehemently refused to use SQL on the project. If my data pipeline had to store anything, I had to send it to the backend via an API. Which I also needed to coordinate with the backend guy to create. You have no idea how incredibly annoying it is to specify "Latitude and longitude shouldn't be required, I cannot always get that information" only for my post requests to be denied in the next pre-production build because the backend guy decided it would be required anyway. Eventually I just gave up and used the good old Null Island. Everything is initialized as empty strings and zeroes, filled in when I can, you deal with the rest.
you becoming my AsmondGold in tech. Funny af.
As a non software engineer, this is unironically true if you want your people to do anything.
This is when the seniors conduct a ritual to justify the use of type any
I cried with laughter after watching this xD
can confirm, its true 👍
It makes complete sense the user will input some info they have at that time and request to find all possible search results
The most annoying part is that the order of fields are even missed up
I'm getting Ask A Ninja vibes from this short
@discipuloschristi6787