Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help4407


This forum is provided to promote discussion amongst students enrolled in Open Source Tools and Scripting (CITS4407).
 
Options:
RSS cloud
Jump to:

Assignment 1 Task 1 quick question

6 of 390 articles shown, currently no other people reading this forum.
photo
From: Ryan O.
Date: Wed 15th Apr 2020, 9:07pm
Actions: 
        Login-to-reply

 

Hi,

Just two quick questions

For task 1 clarification it says " the two dates will both be valid (formats), and 
may be in different years.".

Does that mean i shouldn't even bother checking if they are valid? 

And I'm not quite sure what "successive dates" means in the sentence "Successive 
dates are considered to be one day apart". does it mean two dates which are the same? 

Thanks! :) 

Assignment 1 Task 1 quick question

photo
From: Christopher M.
Date: Thu 16th Apr 2020, 4:31am
Actions: 
        Login-to-reply

 

"Ryan Oakley" <21*9*4*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Does that mean i shouldn't even bother checking if they are valid?

Hi Ryan,

The dates (the inputs) will be valid dates in the correct format.
You do not need to check/verify them.
  
> And I'm not quite sure what "successive dates" means in the sentence "Successive 
> dates are considered to be one day apart". does it mean two dates which are the same? 

It means that one date follows the other (on a calendar).
Such as  16/04/2020 and 17/04/2020;  17/04/2020 and 16/04/2020;  30/04/2020 and 01/05/2020.

Assignment 1 Task 1 quick question

photo
From: Ryan O.  O.P.
Date: Thu 16th Apr 2020, 10:21am
Actions: 
        Login-to-reply

 

Thanks Chris :) 

Assignment 1 Task 1 quick question

photo
From: David M.
Date: Thu 16th Apr 2020, 12:20pm
Actions: 
        Login-to-reply

 

90% of my code is carefully validating the inputs. Only one line does the actual work.
I hope that is not a problem.

Assignment 1 Task 1 quick question

photo
From: Christopher M.
Date: Thu 16th Apr 2020, 12:24pm
Actions: 
        Login-to-reply

 

"David May" <17*1*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> 90% of my code is carefully validating the inputs. Only one line does the actual work.
> I hope that is not a problem.

It won't be a problem (provided it works).
I don't wish to have to diagnose any problems if your validating code, itself, doesn't work.

Assignment 1 Task 1 quick question

photo
From: Lee dB.
Date: Fri 17th Apr 2020, 8:55am
Actions: 
        Login-to-reply

 

"Christopher McDonald" <ch*i*.*c*o*a*[email protected]*a*e*u*a*> wrote:

> "David May" <17*1*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:
> 
> > 90% of my code is carefully validating the inputs. Only one line does the actual work.
> > I hope that is not a problem.
> 
> It won't be a problem (provided it works).
> I don't wish to have to diagnose any problems if your validating code, itself, doesn't work.

I’ve been debating myself whether to validate or not, and have tended towards only performing minimal 
validation, and relying on utilities like date to perform the validation and trapping any errors. I’m 
not sure if this is the right approach (and probably isn’t really defensive programming), but I feel 
like it contributes to more compact, readable code - and given that these are small utilities, seems 
like the right philosophical approach. 

What are your thoughts on this, Chris?
This Page


Program written by: [email protected]
Feedback welcome
Last modified: 11:27am Sep 21 2020