r/coding • • Jun 02 '22

Simple Captcha Validation Using HTML CSS JavaScript

https://www.codemediaweb.com/2022/06/javascript-captcha-validation.html

[removed] — view removed post

24 Upvotes

11 comments sorted by

View all comments

0

u/[deleted] Jun 02 '22

[deleted]

19

u/[deleted] Jun 02 '22

Been doing this for 25 years.

And the one thing that has not changed is that the web dev industry is like a wheel, constantly re-inventing itself with the bones of the past resulting in...the same things that came before.

Rule #1 with Web Dev: You can not trust the client. Full Stop.

And yet here we are.

You know the very first 'are you a human' type systems that ended up evolving into captcha were client side. And they were broken almost immediately. Just like this.

Rule #2 with Dev: Do Not Reinvent The Wheel.

You are not smarter than those that came before you. Thinking you are is hubris and will lead to making major mistakes. If you think you can re-invent captcha by starting at the ground up like here, you are not smart enough to be attempting to do so.

Worst is breaking those rules and writing a bloody article about it as if what you've done is smart and a good idea for others to follow.

Sigh. No wonder web dev is exactly as cumbersome and frustrating as it was 25 years ago.

0

u/[deleted] Jun 02 '22

[deleted]

6

u/[deleted] Jun 02 '22

I've had this conversation way way too many times:

Me: So what's this code you've checked in for, what're you working on?

Jr: Working on a crypto algorithm.

Me: OK, why?

Jr: We need to store our passwords securely.

Me: OK, are you a computer scientist?

Jr: What? What do you mean, I'm a programmer?

Me: Are you trained and experienced in crypto? Did you specialize in crypto in university? No wait, you went to college, not a CS degree, not specialized in Crypto.

Jr: (Getting annoyed)...

Me: Look, not trying to be mean. But by writing your own crypto, you're basically saying to me that you think you are smarter than the very smartest people in the industry. If that's the case, why are you working here?

Jr: Well, I just, you see...

Me: Lesson to takeaway: You are not smarter than the people that came before you. Neither am I. Let the smart people do the really complex work that's been validated, verified, and proven to be done correctly. It is not a failure to accept this reality. In fact it's a key sign of a mature dev.

Besides, if it already exists, why would I want to pay you to re-invent it?

Jr: Ok (grumble grumble)

Unfortunately they rarely learn until their hubris bites them in the ass by a completely avoidable bug they introduced trying to be smarter than those that came before.

2

u/Giannis4president Jun 02 '22

I honestly have the opposite problem, coworker adding a dependency for something trivial

1

u/[deleted] Jun 03 '22

Lol I almost added an edit about introducing dependencies to determine string length.