A
Arne Vajhøj
Arne said:Lew said:markspace wrote:
bilsch wrote:
Many things are because I mimic what I see in other programs... I
hope I can finish this project without understanding threads
Yeah, that's an issue. When teaching someone, is it better to let them
do it the simplest, but wrong, way? Or should you teach them to write
code they don't understand, but promise too "explain it later?"
I'm actually in the latter camp at the moment. I'd rather see you copy
and paste good code, than let you get into the habit of writing bad code
that you feel you understand. It a style of learning thing, more than a
programming thing, but I think it's better to get you into the habit of
looking at correct code now, so it doesn't seem strange when you see the
correct version later.
OTOH, it's not going to adversely effect your small programs. The
chance of you hitting a threading error in such a small program is
virtually nil. Just be aware that: 1. the code really is wrong, and 2.
you'll have to learn threads eventually.
They've already hit a threading error.
How is that "virtually nil" chance?
Usually "hit [by] an error" means actually impacted by the error.
I did not see any case of such.
Have you run the OP's code?
On a multi-processor system?
I had not.
Now I have.
I expect OP to have too.
The chance of actually getting a problem by starting
the GUI in main thread instead of event thread is pretty
small.
Otherwise the wrong way of doing it would not have
been used for so many years.
Arne