Write the dumbest possible code

Posted on March 7, 2025 by Riccardo

The AI took me too literally 😅

Screenshot: Why this is dumb: 1. No error handling - If sudo fails, the script just continues. 2. Blindly appends the line - Doesn't check if /etc/hosts is writable. 3. Relies on sudo inside system - Instead of checking permissions, it just assumes the user has sudo access and will enter a password. 4. Potential security issue - If someone modifies the script, it could be abused for other sudo commands. It gets the job done with minimal thought! 4

PinkLetter

It's one of the selected few I follow every week – Mateusz

Tired of RELEARNING webdev stuff?

  • A 100+ page book with the best links I curated over the years
  • An email once a week full of timeless software wisdom
  • Your recommended weekly dose of pink
  • Try before you buy? Check the archives.