How I Scrubbed 100% of the AI Slop From My Game & Cut Code by 45%

Three weeks ago, I had 191,000 tokens in my upcoming tactical survival roguelite game’s codebase. Today, I have 104,000 tokens: a 45% reduction. Here’s what I learned about AI-generated code and why removing it made my game better. The Problem with AI-Generated Code What is “AI Slop”? AI slop refers to code that: Works but is unnecessarily verbose Lacks clear intent and purpose Contains redundant patterns Has inconsistent style Includes unnecessary abstractions Lacks proper error handling Has poor performance characteristics Why Does It Happen? AI tools like ChatGPT and GitHub Copilot: ...

December 10, 2025 · 3979 views

Java Isn't Verbose - You Are: Writing Concise Java Code

Java is often criticized for verbosity, but modern Java can be concise. Here’s how to write cleaner code. Modern Java Features Records (Java 14+) // Old way public class User { private String name; private String email; public User(String name, String email) { this.name = name; this.email = email; } // Getters, equals, hashCode, toString... } // New way public record User(String name, String email) { } Pattern Matching (Java 17+) // Old way if (obj instanceof String) { String s = (String) obj; System.out.println(s.length()); } // New way if (obj instanceof String s) { System.out.println(s.length()); } Switch Expressions (Java 14+) // Old way String result; switch (day) { case MONDAY: case FRIDAY: result = "Weekday"; break; default: result = "Weekend"; } // New way String result = switch (day) { case MONDAY, FRIDAY -> "Weekday"; default -> "Weekend"; }; Best Practices Use Streams // Old way List<String> filtered = new ArrayList<>(); for (String name : names) { if (name.startsWith("J")) { filtered.add(name.toUpperCase()); } } // New way List<String> filtered = names.stream() .filter(name -> name.startsWith("J")) .map(String::toUpperCase) .toList(); Use Optional // Old way String result = null; if (user != null && user.getName() != null) { result = user.getName().toUpperCase(); } // New way String result = Optional.ofNullable(user) .map(User::getName) .map(String::toUpperCase) .orElse(null); Conclusion Modern Java is concise when you: ...

July 20, 2023 · 4015 views