I find the issue there is usually just jargon. It’s fine to write really abstract code, but do try to find words to express what you’re doing. If you can’t find words to describe what you’re doing, then yes, it’s probably too abstract. If the best variable name you can think of is “x”, you probably need to tone down the abstractions a little.
The two best tricks I have to avoid write-only code:
- Code review — Show your code to someone, explain what it does. The parts that are hard to explain now will be hard to understand later.
- Rewrite your functions. Make a habit of deleting a function and rewriting it from memory. I notice this often improves the clarity and readability (it even fixes some bugs from time to time). Hack the first version, delete, write the proper version. This also helps keep down the size of your functions I feel.