- Knowledge
- technology
- OOP
- Tips
- Programming
- Tips
- Tutorial
- SEO
- Ranking
- Knowledge
- Special Day
- Seo
- Bug
- Data science
- Seo
- artificial intelligence
- Machine Learning
- Robotics
- happyNewYear2021
- newYearEve
- 2021
- Automation
- Smart Home
- Career
- Best Practices
- Git
- Logging
- Web Fundamentals
- DNS
- HTTPS
- Performance
- AI Tools
- ChatGPT
- Claude
- Gemini
- Laravel
- Eloquent
- MySQL
- HTTPS
- TLS
- Web Security
- Certificates
- Developer Life
- Debugging
- Docker
- DevOps
- Transactions
- Queues
- LLMs
- AI
- AI Coding
- Developer Tools
- React Native
- Expo
- Kate PMS
- Mobile Apps
- Laravel
- Authentication
- Sanctum
- Cookies
- API Design
- Payments
- Idempotency
- DeepSeek
- Open Source AI
- LLMs
- AI News
- Git
- Version Control
- AI Coding
- Prompting
- PHP
- Checklist
- MCP
- AI Agents
- OpenAI
- Architecture
- Microservices
- Modular Monolith
- Estimation
- Developer Life
- Project Planning
- Humour
- OAuth
- OpenID Connect
- Authentication
- Embeddings
- Vector Search
- RAG
- pgvector
- OpenAI
- GPT-4.1
- Codex CLI
- Events
- Testing
- Clean Code
- Maintainability
- Code Review
- Webhooks
- API
- Security
- Claude Code
- Workflow
- AI
- LLM
- Prompt Injection
- Mobile
- React
- Networking
- TCP
- UDP
- HTTP/3
- CLAUDE.md
- AWS
- Cloud Security
- Backups
- PHPUnit
- Software Engineering
- Leadership
- Communication
- RAG
- Embeddings
- AI Engineering
- IT Infrastructure
- Networking
- Access Control
- CI/CD
- GitHub Actions
- Gemini CLI
- Claude Code
- JavaScript
- Async/Await
- Node.js
- Promises
- Security
- Cryptography
- Passwords
- MySQL
- Database
- Vibe Coding
- Software Quality
- DNS
- Code Reading
- Onboarding
- Productivity
- Background Jobs
- Developer Humour
- Estimates
- Dev Life
- JWT
- o3-mini
- DeepSeek R1
- Rate Limiting
- Kate PMS
- E-Signing
- Audit Trail
- REST
- GraphQL
- API Design
- Laravel 12
- Upgrade Guide
- Open Source
- Self-Hosting
- Task Scheduling
- Cron
- Secrets
- CORS
- PHP
- PHP-FPM
- OPcache
- GitHub Copilot
- Software Architecture
- Engineering
- TypeScript
- JavaScript
- Type Safety
- AI Security
- React Native
- Product Design
- AI Agents
- Kiro
- Queues
- Redis
- RabbitMQ
- AWS SQS
- Nginx
- Apache
- GPT-5
- gpt-oss
- Clean Code
- Architecture
- Naming
- Documentation
- Career
- ADR
- Teamwork
- Supply Chain
- Kate HRM
- HR Software
- Permissions
- System Design
- Pagination
- SSH
- Linux
- Big O
- Databases
- Laravel Boost
- MCP
- Developer Skills
- Validation
- Databases
- Indexes
- Code Quality
- Deployment
- Developer Humour
- Feature Flags
- Code Review
- Pull Requests
- Docker
- Cursor
- Authorization
- RBAC
- Gemini
- Long Context
- PHP 8.4
- Caching
- Dependency Injection
- Web Performance
- Browser
- CSS
- Database
- Migrations
- ChatGPT
- AI for Developers
- Monitoring
- On-Call
- REST
- Backend
- SQL
- NoSQL
- Database Design
- Coding Agents
- Claude 4
- API Resources
- REST API
- Load Balancing
- Scaling
- AWS
- AI Tools
- Claude
- Sora 2
- CTE
- 2FA
- TOTP
- Programming Languages
- Prompts
- Developer Workflow
- API Gateway
- APIs
- Passport
- API Auth
- Learning
- Burnout
- Developer Growth
- Web Development
- SEO
- Kate Mall
- ChatGPT Atlas
- Agent Skills
- Middleware
- Laravel 12
- Collections
- Context Window
- Monitoring
- Commit Messages
- Self Review
- Growth
- Regex
- Programming Basics
- Text Processing
- Database Design
- Normalization
- Linux
- Server Security
- Linux Foundation
- Open Standards
- Legacy Code
- Documentation
- AI Workflow
- File Uploads
- Test Data
- Hashing
- Performance
- Caching
- Enums
- Scope Creep
- Estimation
- Codex
- Gemini CLI
- Timezones
- Carbon
- Bugs
- PHP 8.5
- Gemini 3
- GPT-5.1
- Data Integrity
- Event Loop
- Async
- Opus 4.5
- AI Models
- React
- Forms
- Frontend
- Backups
- AI Images
- DALL-E
- Midjourney
- Race Conditions
- Concurrency
- Legacy Code
- Refactoring
- Senior Engineer
- Scope
- LLM
- CDN
- Web
- Sub-Agents
- Soft Deletes
- Audit Log
- Concurrency
- AI Learning
- NestJS
- AI Evals
- Policies
- SPF DKIM DMARC
- Unicode
- UTF-8
- Knowledge Graph
- Value Objects
- Technical Debt
- Feature Flags
- Laravel Pennant
- Deployment
- Copilot
- Composer
- Dependencies
- Artisan
- Automation
- AWS S3
- Object Storage
- Cloud
- Small Language Models
- Ollama
- Production
- Sessions
- HTTP
- Mentoring
- SQL
- Virtual Machines
- Web Development
- HTTP/2
- QUIC
- Web Performance
- AI Integration
- LLM API
- SOLID
- OOP
- Hosting
- Serverless
- Merge Conflicts
- Temperature
- AI Development
- Reverse Proxy
- Nginx
- Infrastructure
- Verification
- Passkeys
- WebAuthn
- Teams
- Communication
- Stakeholders
- Monorepo
- CI/CD
- Versioning
- JSON Schema
- Livewire
- Inertia
- Meetings
- Distributed Systems
- Privacy
- Full-Stack
- T-Shaped Skills
- Money
- Notifications
- Web Security
- HTTP Headers
- CSP
- Function Calling
- Load Testing
- k6
- Data Extraction
- Debugging
- WebSockets
- SSE
- Real-Time
- Laravel Reverb
- Infrastructure as Code
- Terraform
- Side Projects
- Laravel Pint
- OpenAPI
- Swagger
- UX
- Multimodal
- Jest
- Pair Programming
- APIs
- Rate Limiting
- Resilience
- Dev Humour
- Design Tokens
- JWT
- API Keys
- Sessions
- PHPStan
- Rector
- Incidents
- Reporting
- Dashboards
- Zero Trust
- IAM
- Search
- Laravel Scout
- Junior Developers
- Mentoring
- Images
- WebP
- AVIF
- Bug Reports
- Let's Encrypt
- Design Docs
- Software Design
- Observers
- Replication
- Accountability
- Data Structures
- Reliability
- LLM Memory
- Error Handling
- Payments
- Payment Gateway
- Webhooks
- PCI DSS
- Observability
- OpenTelemetry
- Personal Brand
- Writing
- Conventions
- Dates
- Scheduling
- Disaster Recovery
- Compression
- Brotli
- Deadlines
- Developer Habits
- State Machines
- Tech Roles
- UUID
- ULID
- Horizon
- Planning
- Engineering Culture
- Ownership
- Soft Skills
- Socialite
- Cost Control
- Collations
- Unicode
- Octane
- PostgreSQL
Naming Things: A Tour of the Hardest Problem in Computer Science
About Post
There's an old joke, usually credited to Phil Karlton: there are only two hard things in computer science, cache invalidation and naming things. Developers have since added a third: off-by-one errors.
We laugh, and then we open a file and find $data2. Written by us. Last Tuesday.
So let's take a short tour of the naming hall of fame. You'll recognise most of the exhibits. Some of them you've probably committed.
The exhibits
❌ $data, $data2, $newData. Everything in a program is data. Calling a variable $data is like labelling a moving box "stuff". And $data2 tells you only that someone ran out of ideas after $data.
❌ $temp. Temporary, it promised. It has now survived three refactors, two framework upgrades and a change of team.
❌ report_final_FINAL_v3_fixed.php. Version control exists so this file doesn't have to. If you see it in a repository, someone was scared of Git, and possibly still is.
❌ handleStuff(), processData(), doIt(). Functions that do something. To something. For reasons.
❌ Helper, Utils, Manager. The junk drawer of class names. StringHelper starts with one method and ends up holding date formatting, a currency converter and a function that sends Slack messages.
❌ $isNotDisabled. Now write if (! $isNotDisabled) and see how long it takes your brain to land. Double negatives are a tax on every reader, forever.
❌ $timeout = 30. Thirty what? Seconds? Milliseconds? Minutes? Somebody will guess wrong, and they'll guess wrong in production.
❌ $usr, $cstmr, $amt. Vowels are free. They have always been free.
❌ The liar. A function called getUser() that also updates the last-login time, sends an analytics event and occasionally creates the user if it doesn't exist. The name is a promise, and this one is broken.
Why it's actually hard
Naming isn't hard because we're lazy. It's hard because a good name requires you to know exactly what the thing is. When you can't name a function, it's often because it does two things. When you can't name a variable, you might not be sure yet what it holds.
That's the useful secret: a bad name is often a design smell, not a vocabulary problem. processData() is hard to name because it's doing validation, saving and emailing at once. Split it, and the names write themselves: validateInvoice(), saveInvoice(), sendInvoiceEmail().
Rules that actually help
✅ Name by role, not by type. $overdueInvoices, not $invoiceArray. The type changes; the meaning doesn't.
✅ Booleans read as yes/no questions. $isActive, $hasSignedContract, $canApprove. Then if ($tenant->hasSignedContract) reads like a sentence.
✅ Put the unit in the name. $timeoutSeconds, $amountInCents, $maxFileSizeMb. One word prevents a whole category of bugs.
✅ Functions are verbs, and the verb should be honest. get means no side effects. If it creates or changes something, say so: findOrCreateUser(), recordLogin().
✅ Name length follows scope. $i is fine in a three-line loop. A class property that lives for years deserves a full, descriptive name.
✅ Pick one word per concept. If the codebase says tenant, don't introduce renter, occupant and resident for the same thing. Use the words your users and business use, so code and conversations match.
✅ Rename without fear. Modern editors rename safely across a project in seconds. A bad name you're "used to" is still a bad name for the next person.
The two-second test: if a colleague can't guess what a variable holds or what a function does from its name alone, in about two seconds, rename it. If you can't find a good name, look at whether the thing is doing too much.
A small confession
I still write $temp sometimes, usually at the end of a long day when I just need the code to run. The trick isn't never doing it. It's catching it before the pull request. These days I read my own diff once just for names, and it's one of the cheapest quality checks I know.
AI assistants help here too, as long as you ask. "Suggest clearer names for the variables in this function" is a great prompt, and it costs nothing to ignore the bad suggestions.
What's the worst variable or function name you've ever found in a codebase? Bonus points if you wrote it yourself.

Be first to comment it...