In Calculating Julian dates, the author asks a question that doesn't make sense:
Refactor this code so that I don't have to insert the parameters any time I need to use one of the functions.
What I would like to do in
main()is to be able to use
calc_juliandate()without having to call it and pass its attributes each and every time I need it in another function, as in
dates_diff(). Any suggestions about coding style or implementing this?
I can't understand the refactoring request, nor can others, as the question has attracted several votes to close for being "not clear what you are asking".
It would be not quite right to close the question, since there are obvious problems with the code (as pointed out in answers from @tomdemuyt and myself). I would say that there is a good question here, and the author probably knows that the code needs improvement but is not expert enough to put the question in the right words.
What's an appropriate course of action?
- Try to squeeze in an answer before the question gets closed?
- Let the question get closed, then hope that someone (the OP or another user) reworks it, then wait for it to get reopened?
- Short-circuit the close-rework-reopen process and just fix the question for the OP (by stripping out the specific refactoring request)?
- Write a comment pleading for lenience from those who might vote to close?