3 ms·
I just watched a video where someone demo’d GitHub Copilot by writing a comment along the lines of // IsValidEmail takes a string and returns whether it’s
by maddyboo 5y ago
I just watched a video where someone demo’d GitHub Copilot by writing a comment along the lines of
// IsValidEmail takes a string and returns whether it’s a valid email address
The AI response was a nightmarish 100+ character regex that made my blood curdle.
I think of email validation like encryption: don’t roll your own, and don’t trust an AI to do it either.
Edit: Here's the regex: https://gist.github.com/cassidoo/6101ef0657665683b787aab5ae9465f4#file-copilot-suggestions-js-L5-L9 https://gist.github.com/cassidoo/6101ef0657665683b787aab5ae9...
- ToFab123 5y ago100+ is nothing. This is a regex that validates a string against the RFC822 "Standard for ARPA Internet Text Messages" and it contains 6424 characters. http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
- bombcar 5y agoThis is a Tony the Pony situation almost.
- cyberCleve 5y agoDoes it work?
- justinator 5y agoYeah basically, but it doesn't validate an email address (user@example.com), it validates say, the From: header of a MIME message, which could contain an email address, a phrase (like a first and last name) comments, and all sorts of dumb dumb ideas like having phrases that have embedded comments and phrases that look like email addresses but aren't and on and on and on. This RFC is a trainwreck and whoever wrote it should feel bad about themselves.
- slaymaker1907 5y agoThis really seems like it is plagiarizing the regex from somewhere without citation.
- maddyboo 5y agoIt looks like it: https://twitter.com/xooorx/status/1410776673985994754 https://twitter.com/xooorx/status/1410776673985994754 https://stackoverflow.com/a/38137215 https://stackoverflow.com/a/38137215
- genewitch 5y agoall AI is plagiarizing something, though. Computers cannot reason, they can just jam stuff together that satisfies whatever the program says. ML is matrix math (generally) - stuff that you can do by hand, computers are faster at it. As fancy as GPT and co-pilot are, it's all copied from somewhere.