开发者

pseudo code - formal rules

Has anyone set out a proposal for a formal pseudo code standard?

Is it better to be a 'rough' standard to i开发者_StackOverflownfer an understanding?


It is better to be a rough standard; the intent of pseudocode is to be human-readable, not machine-readable, and the goal of actually writing pseudocode is to convey a higher-level description of an algorithm while being unconcerned (typically) with the minutiae of the implementation. My opinion is that for it to qualify as pseudocode there has to be some ambiguity, and your goal should be a clear conveyance of your algorithmic intentions. Stick to common control structures, declarations and concepts that are paradigmatic to your target audience or language and you'll get the point across. If you start getting too formal, you're getting too close to writing actual code.


NOT AN ANSWER.

IMHO forcing a standard (pseudo code syntax, if you will) will cause people to be less clear on what they want to say.

Browse around, try to gather some knowledge about used conventions, and do your best to be clear.


Although this is by no means a formal proposal, Python is considered by some to be Executable Pseudocode.


in my opinion it depends on the people who are using your programs. In books for algorithms the pseudo code is very formal an near to maths, but is also described in a few paragraphs, so this is for scientific situations.

If I develop in others environments I would prefer a not that formal way because that is easier to understand for most people. I prefer spoken words over formalism. If you want formalism you could read the code instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜