To me, it's comparable to writing a paper; I could never write a paper without a proper outline and knowing where I'm starting and where I'm going.
Understanding the algorithm, the states, the model, the constraints, the dependencies, the properties,... at all times is what makes you an engineer.
Technical standards and publications about real life issues (like mutex, db management,...) often use pseudo code, because the actual implementation doesn't matter.
Pseudo code is also relevant because languages change anyway. And in some companies and industries, several teams use totally different codes you won't know of.
Coding right away is possible. But it's not the same job. You can be paid big for actually thinking through your code, and not just writing it.
Besides, test-first development is inherently writing pseudocode where you write MagicFunction() and then TestMagicFunction() and iterate to flesh out both.
Also, who doesn't write a first pass of some code and then drops a comment that says /* handle special cases x, y and z here */ for later?
All of that is pseudocode.
Languages like TLA+ can be considered as a form of pseudocode as they cannot be compiled down to code.
Yet TLA+ is used very much in the real world for describing complex algorithms.
Then there's always the joke about Ruby, where you just write pseudocode and the interpreter just runs it.
I will note though that when I was in school there was an “official” pseudo code, and I’ve never met anyone who uses that. It’s usually just a lazy C syntax.
- In design docs:
- use pseudocode for complex business logic, and/or algorithmic parts (similarly as it's used in scientific papers)
- Also use it when MSD (Message Sequence Diagrams) would be too complex, or too detailed
- Pro tip: If you're writing design documents and you're pressed for time, start by writing pseudocode. Later, if you have extra time, you can convert the simpler ones into diagrams or other relevant visuals.
- In code comments: - use it in case when code is non-trivial, or hard to understand
- use it for a placeholder for yet to be written code, or in TODOs