Stop Using “Singleton” Pattern

Let me improve your coding skills with this single technique

.com software
2 min readSep 13, 2022
Photo by Will Porada on Unsplash

Do you want to be a good developer quicker, and write beautiful, solid code? Learn from other people.

Don’t make beginners’ mistakes and stop applying the singleton pattern completely.

Between us (but keep it secret will you?), I must admit that it was the first programming pattern that I learned in my life. Delighted by its simplicity, in my infinite ignorance and selfishness — I used it practically everywhere.

I couldn’t be dumber; I can see it clearly from today’s perspective. I was inexperienced and lazy.

I had to spend countless hours reading books, watching videos, and attending conferences about good programming to come to such conclusions.

Shared state is the root of all evil” remember that. And it’s best to write down this sentence on a post-it note and stick it on your monitor.

I have been programming professionally for several years. I have worked in large and small…

--

--

.com software

Father • PHP developer • entrepreneur • working for a €1bn unicorn startup as a backend engineer >>> https://bit.ly/dotcom-software