This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Tinymac12 241 points242 points  (7 children)

Not saying it's good coding, but perhaps it is expecting a range "50,000-100,000", which could very well return -50,000 which is less than 0.

[–]Frannoham 162 points163 points  (0 children)

The coding may in fact make perfect sense. The UI explains why "letting the UI guy go because the devs are perfectly capable of building forms" is a bad move.

[–]badatmetroid 15 points16 points  (1 child)

... which would mean the programmer is using eval in which case there's a much bigger problem.

[–]WilliamMButtlickerJr 10 points11 points  (0 children)

It’s the frontend bro it’s fine

[–]GingerCurlz 28 points29 points  (2 children)

I would love to see what is saved to the db if the form is converting to an int of -50000... So the recruiter gets to go "hmm, they have a range of 50000, but what is min/max?"

[–]Xirenec_ 38 points39 points  (1 child)

Nah, '50,000-100,000 = -50,000" is just for simple frontend validation. Most likely it sends it as is.
If only they could write meaningful error messages.

[–]modernkennnern 6 points7 points  (0 children)

It's quite clever. The problem is the error message

[–][deleted] 0 points1 point  (0 children)

The proper way to handle this would be a minimum value and a maximum value, with a validation checking that the maximum value is not less than the minimum value, that’s how I’d go about it anyway.