If you have written one programming language for most of your career, some of its habits no longer look like habits. They look like the way programming works. Objects hold state. Errors are thrown. Loops go over lists. Null is a thing that exists. You stopped noticing these as choices a long time ago.
The quickest way to see them again is to spend some time in a language that made different choices.
The key word is different. Moving from one mainstream object oriented language to another teaches you new syntax and very little else. Pick something that disagrees with you. If you live in Java or C sharp, try a functional language where data does not change after it is created. If you write Python, try something with a strict compiler that refuses to run your code until the types line up. If everything you do is high level, spend a month with a language that makes you manage memory yourself.
At first it will feel clumsy, and that clumsiness is the point. Every time you reach for a familiar move and it is not there, you have found an assumption. Why can I not just change this value? Why does the compiler insist I handle the empty case? Why is there no exception here? The answers are the lesson, because each one explains a class of bugs that language decided to make impossible or at least awkward.
Keep it small. You do not need to become fluent, and you do not need a job in it. Build one real thing, something a few hundred lines long that you would actually use, and finish it. That is enough to feel the language push back.
Then bring one idea home. Most people find that their everyday code changes after this, even though the language never does. You start returning values instead of throwing for expected failures. You stop mutating things you passed in. You write the empty case first. Your colleagues will not know where it came from. They will just notice fewer surprises in your code.
Monday: pick the language your current one would disagree with most, and write the smallest program in it that does something you care about.
– Asael Shinder
Top comments (0)