How to prevent form spam

After publishing a quick little project to support contact forms on static websites, I was asked how spam should be handled.

Preventing common spam really isn’t all that hard, so I figured I’d write down a couple of techniques that should be useful for any contact form, comments section or really any form that accepts user input.

While there’s no silver bullet against spam bots, it’s easy enough to make it inconvenient enough for spammers to bother.

Programmers don't evolve

I recently worked on a software metrics tool, which taught me a lot about the architecture of some of my work.

Then I calculated the difference in metrics between mine and previous commits, plotted the results, and looked at my personal progress. Nothing!

Don't ask that question

I’ve always been afraid of asking stupid questions. Silly, right? So I usually make sure I’ve done thorough research before asking a question when I get stuck. I also hate not understanding how things work. So I just try to figure them out. You should do the same!

Measuring software coupling

Coupling is about how objects in your application are connected: which objects depend on which, and how does that affect the entire system’s stability?

An application has tight coupling when a lot of components depend on each other. This should usually be avoided because a change in 1 place can cause issues in any of its dependencies.

So what does coupling tell you about your classes?

Measuring software complexity

When asked for estimates, you usually don’t have much more than your gut feeling to go on. You just know that this one thing is going to take longer because it’s more fragile than that other thing. But why is that?

People much smarter than me have researched this subject and there are good ways of measuring how complex a piece of code is.