Thinking Simple in Coding: Why You Should Think Before Asking AI

Junior dev copies 50 lines of AI code they do not understand. 4-level chaining, 7 folders for 1 endpoint. AI tools are great, but the skill of thinking simply is fading. Simple first + YAGNI philosophy.

· · 8 min read

I've been noticing a concerning pattern in today's developers. Error → immediately copy-paste to ChatGPT. Building a feature → immediately ask "how to do X in React?" Debugging → immediately ask "why this error?" Without thinking. Without trying.

I'm not anti-AI. I use Claude daily to write articles and help debug. But there's a difference between using AI as a tool and using AI as a replacement for your brain.

What I see: junior devs increasingly skip the "think simple" step. They jump straight to complex AI-generated solutions, without asking "is this actually simple?" Or "do I really need this level of complexity?"

This isn't an "AI is bad" article. It's about the most important yet most neglected skill: thinking simply.

---

Case 1: 3-Level Array Filter

I saw a junior dev write this:

// Asked AI, got a complex solution
const result = data
.filter(item => item.status === 'active')
.map(item => item.name)
.filter(name => name.startsWith('A'))
.reduce((acc, name) => {
acc[name] = name.length
return acc
}, {})

The code "works." But when asked "what does this do?" they couldn't explain it. Because the code was AI-generated - they didn't understand the logic.

Simple solution: a plain loop, clear, no chaining needed.

const result = {}
for (const item of data) {
if (item.status === 'active' && item.name.startsWith('A')) {
result[item.name] = item.name.length
}
}

4 lines. No .filter().map().filter().reduce(). Faster to run, easier to debug, clearer intent.

Not saying .reduce() or chaining is bad. But if you don't understand how it works and just copy from AI, you learn nothing. And your code becomes fragile - when there's a bug, you can't fix it because you don't understand it.

---

Case 2: "Building a REST API" When You Just Need 1 Endpoint

I once saw a junior dev create this folder structure for an internal tool used by 3 people:

src/
├── controllers/
├── services/
├── repositories/
├── middlewares/
├── validators/
├── types/
├── utils/
└── config/

They used clean architecture, dependency injection, unit tests, integration tests - all best practices. I asked: "What does this API do?"

Them: "Just 1 endpoint, POST /submit, receives JSON, stores to database."

Me: "Why not just 1 file? You need 7 folders for 1 endpoint thats 50 lines?"

Them: "Because best practices say so."

This is what I call over-engineering out of fear. Junior devs are afraid of being called "not using best practices" or "unprofessional." So they copy enterprise tutorial structures designed for 1000 endpoints - when they're just building a simple script.

Simple solution for a 3-user internal tool:

// api/submit.js - 1 file, 50 lines, done
app.post('/submit', async (req, res) => {
const { name, email, message } = req.body
if (!name || !email) return res.status(400).json({ error: 'required' })
await db.query('INSERT INTO submissions (name, email, message) VALUES ($1, $2, $3)', [name, email, message])
res.json({ ok: true })
})

Not saying complex architecture is wrong. But: choose complexity based on need, not because "best practices." Best practices for a 1000-endpoint enterprise app differ from those for a 3-user internal tool. You need to know the difference.

---

Why Developers Increasingly Skip Simple Thinking

1. AI delivers answers too fast.

You paste an error → AI gives an answer in 5 seconds. You don't have time to think "what does this error actually mean?" You get the fix immediately. But you learn nothing. Tomorrow, the same error - you paste it into AI again.

Before AI: you'd read the error, Google it, read 5 Stack Overflow threads, try 3 failing solutions, then the 4th works. That process taught you debugging. Not the fix - the process.

2. "Best practice" culture.

There's a culture where "it's best practice" makes devs afraid to think independently. "Clean architecture is best practice" - yes, for a 500-file app. For a 50-line script? Not needed. But junior devs don't know the difference because nobody taught them "when best practice is overkill."

3. Ego - "I need to use cool tech."

Sometimes devs choose complex solutions not because they're needed, but because they look cool. "I use Kafka" - when a database queue would suffice. "I use microservices" - when a monolith would do. "I use Redis" - when in-memory caching is enough.

Simple solutions look "ordinary." Nobody says "wow cool" when you use a for loop instead of reduce. But simplicity is underrated.

---

The "Simple First" Philosophy

What I practice now: always start with the simplest possible solution that might work, then add complexity only when proven necessary.

Not: "use best practices first, simplify later."

But: "use the simplest solution first, complexify later if needed."

// Simple first - 1 file, 50 lines
app.post('/submit', handler)

// Later, if needed:
// - Complex validation? Add a validator
// - Multiple endpoints? Split into controllers
// - Unit tests? Add tests
// But start with 1 file first

This is different from "coding carelessly." You should still write clean code. Just don't add unnecessary abstraction layers before there's evidence they're needed.

YAGNI - You Ain't Gonna Need It. A principle from Extreme Programming thats 20+ years old, but increasingly relevant. Don't add features/abstractions before they're proven necessary.

---

Simple Solution Checklist

Before asking ChatGPT or Googling, ask yourself:

1. "Can this be solved with a plain loop?" - Many seemingly complex problems just need a for loop + if.

2. "Can this use a built-in function?" - JavaScript has .sort(), .filter(), .find(), .includes(). Python has collections.defaultdict, itertools. Do you know these, or only AI does?

3. "Is this a real problem or just a perception problem?" - Sometimes a "complex error" is just a typo, missing import, or environment issue. Read the error first, don't copy-paste immediately.

4. "If I were writing this from scratch, how would I do it?" - Before letting AI generate 50 lines, think: if you were writing it yourself, where would you start? If you don't know where to start, AI won't teach you - it'll only give you an answer.

5. "Would 5 lines be enough?" - Most programming problems can be solved in 5-10 lines. If your solution is 100 lines, you're probably over-engineering.

---

Example: Filter Unique Items

// AI generated - complex, using Map + spread + reduce
const unique = [...new Map(items.map(item => [item.id, item])).values()]

// Simple solution - Set, clear, readable
const seen = new Set()
const unique = items.filter(item => {
if (seen.has(item.id)) return false
seen.add(item.id)
return true
})

Both solutions work. But the first uses Map + spread + .values() - if you don't understand Map, you can't debug it. The second: Set + filter - clear, readable, easy to modify.

---

What This Doesn't Mean

Thinking simply doesn't mean:
• Don't learn architecture - learn it, but don't use it before you need it
• Don't use AI - use AI, but as a tool, not a brain replacement
• Write sloppy code - code should still be clean, just without unnecessary layers
• No best practices - best practices matter, but know when to apply them

It's about balance. Know when to use a simple solution and when you need complex architecture.

---

An Honest Closing

I used to over-engineer too. 7-level folder structure for a 200-line project. Clean architecture for an internal script. Redis when new Map() would suffice. I thought it was "professional."

Now I start with 1 file. When it exceeds 300 lines, I split it. When I have 3+ related files, I create a folder. Not because "best practices" - but because the code is getting hard to navigate. Complexity should be driven by need, not dogma.

The philosophy I learned: coding isn't about using the coolest tech. Coding is about writing a solution that works, can be maintained, and that you understand. If AI writes code you don't understand, you don't own that code - AI does. You're just a copy-paste operator.

If you're a junior dev reading this: next time you get an error, don't paste it into AI immediately. Read it first. 5 minutes. Try to think: "what's the actual problem?" If you're still stuck after 5 minutes, then ask AI. The difference: those 5 minutes teach you debugging. AI just gives you the answer.

If you're a senior dev: push your juniors to think before asking. Don't give them the answer directly. Give them clues. Let them find the solution themselves. That's what makes them grow.