Swizec Teller - a geek with a hatswizec.com

Senior Mindset Book

Get promoted, earn a bigger salary, work for top companies

Senior Engineer Mindset cover
Learn more

    Can you make a CAPTCHA to tell coders from non-coders?

    Let's say you want to launch a service. For coders, by coders.

    English: Coder decoder group AN/MSQ-18 (ao in ...
    English: Coder decoder group AN/MSQ-18 (ao in ...

    Let's also say you want only coders. Nobody else should be able to get in.

    Leaving aside any "Haha, launching is _hard_! Allow everyone and tweak incentives so only coders want to join." While essentially true, coders act differently around coders than they do around people, and an exclusive environment could be awesome.

    How do you make a lock only coders can get through?

    The low-tech solution is a manual approval process. When a person signs up, you look at their profile and google around a little bit. Try to find them on Github, see if they have any technical blogs, have ever released a piece of software etc.

    Congratulations! You've just made yourself a bunch of work and excluded the 80% of the coders who don't have a strong web presence or aren't even interested in that sort of thing.

    No, we need an automated test ... something only coders can solve, but trumps everyone else.

    Something that:

    • Every coder can solve.
    • Nobody who isn't a coder can solve.
    • Is simple to test.
    • Takes less than 15 seconds to solve.

    But what's the common knowledge all coders share?

    The for-loop!

    Everyone can write a for loop right!? How do you test a for loop? Wikia:code lists 18 different for loops. Which means there are more ... plus there's languages like Haskell which prefer recursio. I hear there's also a lot of coders out there using CSS and HTML that don't even have a concept for looping.

    Yes, those people are coders too. They write thousands of lines of code. Maybe not programmers - definitely coders.

    Okay that was a stupid idea ... but every coder has got a favourite text editor don't they? If you like a text editor you are definitely a coder. Then again, there are thousands of text editors out there, we can't test this one either.

    Oh hey! Everyone can write a regular expression can't they? At least a very basic one!

    Regular expressions are great, they aren't language specific since they are a language and pretty much everyone has written a basic regular expression once or twice in some of their projects.

    Well, except for the guys writing hardcore C all their lives who are coding rocket launch procedures for SpaceX. Doubt they ever needed a regex. Maybe for grep or sed?

    A plausible solution

    A friend of mine recently (yesterday) had this problem and it seems the final solution is good enough for now.

    To sign up you need to answer one of two questions:

    1. Write a very simple regex. (match New York and New Jersey, but not Newark)
    2. Or find a hidden element on the webpage and click it.

    I was too lazy to do either, so I went into the page source and used node.js to run the snippet of javascript that constructs the redirect url. Also proving that I am a coder. I think ...

    But what about all those coders who are just starting out? Who haven't encountered any of this stuff before? It took me years to first get into regexes ... And what of those who've never come into contact with either regexes _or _front-end web development ... someone coding up controllers for your car's engine, say?

    Question is, how would you make a CAPTCHA to distinguish coders from non-coders?

    Published on June 21st, 2012 in Uncategorized

    Did you enjoy this article?

    Continue reading about Can you make a CAPTCHA to tell coders from non-coders?

    Semantically similar articles hand-picked by GPT-4

    Senior Mindset Book

    Get promoted, earn a bigger salary, work for top companies

    Learn more

    Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.

    Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.

    Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help πŸ‘‰ swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.

    Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers πŸ‘‰ ServerlessHandbook.dev

    Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization

    Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections

    Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog

    Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com

    By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❀️

    Created by Swizec with ❀️