Discussing programming topics with friend

Is it good practice to disccuss programming or DSA concepts with friend during contest, anyway codechef allow to refer materials to understand concepts, if our goal is to learn concepts better?

Ideally for Long challenge you can discuss. For short challenge its not advisable.