• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding pseudocode..  RSS feed

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a new file on following conditions :
• xyz comany rewards program is enabled based on appData parameter appData.xyzEnabled, and
• Rewards card is not yet added to transaction based on transaction HashTable parameter transaction.isxyzCardAdded.

I have added the following pseudocode....please let me know if is it correct pseudocode .
<line>
<if condition="appData.xyzRewardsEnabled">
<if condition="transaction.wagRewardsMemberName">
<line>
Rewards Member:
</line>
<line>
<font name="verdana,22,bold">
<color color="black">
<data value="transaction.wagRewardsMemberName"/>
</color>
</font>
</line>
</color>
</line>
</if>
</if>

Please make a note this is the Pseudocode..only conditions need to be checked ..!!

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any comment on this..??
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral Saxena wrote:Any comment on this..??


Some of the purposes of pseudocode are ...

* It's easier to read than real code -- as it doesn't contain all the edge conditions handling. Is using an unformatted style of XML actually easier to read?

* It is an interim step. It is used to get more detail and hence, get it to real code. Does this help you in this regard?

* It helps with communication -- other programmers (or even users) can understand what you are doing.


In the first two cases, I guess it is your preference. In the third case, I am not sure what you are trying to do.

Henry
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is your pseudocode in XML format?

Pseudocode is just a simplified description of what a computer program is doing. It doesn't have an official syntax and is only meant to be read by other humans; it is not meant for processing directly by a computer. By writing it in XML you're not making it easy for humans to read.
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Saral Saxena wrote:Any comment on this..??


Some of the purposes of pseudocode are ...

* It's easier to read than real code -- as it doesn't contain all the edge conditions handling. Is using an unformatted style of XML actually easier to read?

* It is an interim step. It is used to get more detail and hence, get it to real code. Does this help you in this regard?

* It helps with communication -- other programmers (or even users) can understand what you are doing.


In the first two cases, I guess it is your preference. In the third case, I am not sure what you are trying to do.

Henry


Can you please describe in detail of which third case you are discussing..?
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Why is your pseudocode in XML format?

Pseudocode is just a simplified description of what a computer program is doing. It doesn't have an official syntax and is only meant to be read by other humans; it is not meant for processing directly by a computer. By writing it in XML you're not making it easy for humans to read.


This is Pseudocode is in phtm file format..... !!
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saral Saxena wrote:
Can you please describe in detail of which third case you are discussing..?



Basically, I am saying .... I have little to no idea what you are talking about. Remember that it was a response to this...

Saral Saxena wrote:Any comment on this..??


It is easier to get comments if more people have a better idea of what you are asking.

Henry
 
Steve Fahlbusch
Bartender
Posts: 612
7
Mac OS X Python
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your enligthment from the Wiki:


In computer science and numerical computation, pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading. Pseudocode typically omits details that are not essential for human understanding of the algorithm, such as variable declarations, system-specific code and some subroutines. The programming language is augmented with natural language description details, where convenient, or with compact mathematical notation. The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm. It is commonly used in textbooks and scientific publications that are documenting various algorithms, and also in planning of computer program development, for sketching out the structure of the program before the actual coding takes place.

No standard for pseudocode syntax exists, as a program in pseudocode is not an executable program. Pseudocode resembles, but should not be confused with, skeleton programs including dummy code, which can be compiled without errors. Flowcharts and UML charts can be thought of as a graphical alternative to pseudocode, but are more spacious on paper.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!