It's UWAweek 30 (2nd semester, week 1)

help2002

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 8 other people reading this forum.


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

Login to reply

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

ANONYMOUS wrote:
> > 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.....' https://dl.acm.org/doi/10.1145/800179.810196 )

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  7:24AM Jul 25 2024
Privacy policy