It's UWAweek 10 (1st semester, week 2)


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 1168 articles.
Currently 5 other people reading this forum.

 UWA week 37 (2nd semester, week 7) ↓
SVG not supported

Login to reply

5:05pm Thu 14th Sep, Christopher M.

> > Hi, > the marking rubric assesses the > > Use of functions to perform **distinct actions** to query or update data > > I understand that it is effective to use functions to prevent re-using of the same code. > However I was wondering if it is better practice to use a function to perform a **distinct action** (lets say 10-15 lines of code) even if the action would be completed only one time? Or is it acceptable to just write the 10 lines of code without a function.
As we are not striving for any efficiency, highly readable code is greatly preferred over long sequences of code that, often, are longer than the screen you're reading from. For example, The Clarifications define the order of scheduling in the execute_commands() function, as: unblock any sleeping processes unblock any processes waiting for all their spawned processes (children) to terminate unblock any completed I/O commence any pending I/O ..... which *could* be written as 'one long' sequence of code, or as the more readable: unblock_SLEEPING(); unblock_WAITING(); unblock_completed_IO(); start_pending_IO(); [And from 1977, a very famous paper: 'Debunking the “expensive procedure call” myth.....' )

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy