Discuss the advantages that a simple program has compared to

Discuss the advantages that a simple program has compared to a more complex program that accomplishes the same tasks.

Discuss how organization is related to simplicity.

Discuss how naming is related to simplicity.

Discuss special programming constructs that can make programs simpler.

Is a shorter program always simpler than a longer one? Why or why not?

Solution

1)
-->If the program is simple and short then number of instruction to be executed are less
-->This saves space and time.
-->If we want to make any changes to the program then it is easy when program is simple.
-->The reader can show interest to understand the program if it is simple or else
if it is large and complex it is difficult to understand.So no one will show interest
to understand it.
-->The person who wrote the program has to come and explain.


-----------------------------------------------------------------------------------------------------
2)
-->Managerial habits that inhibit simplicity include “reply all” e-mail responses
and poor meeting management.

-----------------------------------------------------------------------------------------------------
3)
-->Naming the variable correctly makes reader to understand clearly and we can do modifications easily
-->suppose we want to increase the temperature depend on user input
   int increment;
   int temperature=10;
   printf(\"Enter how much you want to increase temperature:\ \");
   scanf(\"%d\",&increment);
   for(int i=0;i<increment;i++){
       temperature++;
       }
   printf(\"Temperature after incremet: %d\",temperature);

from this program user can understand what is going on insted of definig variables a,b..we used exat names
like increment,temperature.

-----------------------------------------------------------------------------------------------------------
4)

-->Shorter programs are not necessarily easier to read or maintain than longer programs.
-->Giving structures to the program is always worth the effort.
-->Sometime to make program short we may use pointers which are difficult to understand and Null pointer cause
unexpected results also.
-->Depends on the situation program simplicity is based.

Discuss the advantages that a simple program has compared to a more complex program that accomplishes the same tasks. Discuss how organization is related to sim

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site