Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   ITSE1429 Assign5-RE (http://www.alice.org/community/showthread.php?t=10870)

relliott44444 10-08-2014 06:59 PM

ITSE1429 Assign5-RE
 
ITSE1429 Assign5-RE
All,
In order to do well with Alice, here are some observations about selection:
The programming exercise that asks us for three different courses of action is effective to learn about the if/else concept. This is because it has enough complexity that we have choices on how to set up the logic in our Alice world's methods.

For example, a nested if/else can be used. The resulting logic automatically appears in our Alice world in a neat indented fashion and this aids readability to our human eyes as we view the logic. It also shows that a consideration for choosing to use a particular logic pattern such as nesting may be in how much readability is affected as logic extends down into multiple levels of depth.

If you used a nested if/else you have seen that successive nesting indents to the right. When requirements dictate a need for more than three possiblities additional if/else nesting results in continual rightward indentation. Hypothetically then, what happens if there is so much if/else nesting that statements go so far to the right that they begin to wrap around to the next line? The computer handles it but human code readers may become exasperated.

Having good readability is important for initial desk checking the progarm logic and for later ease of maintenance.

Richard


All times are GMT -5. The time now is 12:42 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.