4 ms·
> but is that really any more helpful than just reading the code and seeing that join is called on each subprocess and connecting the dots from there? It isn't
by rdtsc 12y ago
> but is that really any more helpful than just reading the code and seeing that join is called on each subprocess and connecting the dots from there?
It isn't if you have been programming using threads before ,"join" is obvious then
But if you haven't and maybe you are a physicist trying to get something done in python, "p.join()" could mean anything -- "Join to what?", "Why is there no argument to join()?" "We are joining the data togther there like a list..." "It looks like we should be stopping the processes but the method is not called 'stop()' so that's not it"...
That is the problem of teaching this stuff by someone who has been programming for a while, this kind of stuff gets internalized and becomes obvious but it is not obvious to a beginner.
- yohanatan 12y agoIn the case where the reader doesn't understand `.join()`, they should look up the following page and read its documentation (which is about as clear as it can possibly be): https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Process.join https://docs.python.org/2/library/multiprocessing.html#multi... Also, I would suggest that the physicist in your example hire a software practitioner [who can be expected to know 'join'] to write his software correctly (rather than trying to half-ass it himself).
- roadie 12y agoWill use this as ammo next time someone complains about my minimalist approach to commenting. I think comments need to be targeted at a specific audience. If you know that only professionals are going to work on your code then I think only high-level comments are probably OK.