Hacker News new | ask | show | jobs
by fooker 1156 days ago
Does anyone actually do this?

I have never seen people write pseudo code as part of the programming process.

Diagrams, comments, tests, stubs sure, but never really pseudo code.

5 comments

I do it regularly but it's always invisible if all you see is the resulting code.

I do it to structure my code, but I remove the comments as I implement it because I try to make it obvious in the code what's being done. You know, regular good programming, pick good names, keep the code reasonably short, add comments when needed, etc.

The same way you won't see the detailed outline of a writing once it has been written. Yet, the author likely started with an outline.

Yes all the time, how else?

I mean if it's just a few lines, a change to existing code, etc, you can jump straight in with actual code.

But if it's a new object/module etc, start by writing some function names, and some rough structure within them, etc. All in IDE/editor. And I wouldn't call it pseudo-code, just a rough outline.

That's exactly my point.

An outline is a very different beast compared to pseudo code.

It's effectively the difference between operational semantics and denotational semantics.

I studied systems engineering and the first class about algorithms and data structures started using pseudocode, then Pascal. And they still do today.
Sometimes, for some confusing piece of functionality that I am developing, I would write pseudocode in a comment first to see whether it makes sense; and would use it as an outline for implementing the feature. I've found it useful. I've never read Code Complete though :-)
>Diagrams, comments, tests, stubs sure, but never really pseudo code.

Hate to break it to you ... but those are all forms of pseudocode (or verification of your process (which is nearly the same thing)) :)