Reversible reaction for Entropy Change of Surroundings When learning about Entropy in my introductory lecture, I learnt that in basic terms, entropy can be spoken about as
$$dS = \frac{dq_{rev}}{T}$$
and the lecturer mentioned that as Entropy $S$ and $T$ are state functions and $dq_{rev}$ is a path function, this can't hold true all the time for the surroundings. 
Hence, to solve this problem, the reaction must be a reversible process, so that the heat is delivered very slowly. As a result, the heat flow will be very very slow. He didn't make any further explanation to this statement.
I'm slightly confused by this statement that he made.
I can't understand the purpose of the reaction having to be reversible in order to calculate the entropy of a reversible reaction.
Must the reaction be reversible so the temperature of the system and the surroundings be very close, so that the heat flow rate can be made very slow, or is there another reason? 
 A: The reason it's convenient to assume a reversible process is that—in addition to being transferred during heat transfer—entropy is created whenever energy moves down a potential gradient such as a temperature difference. The entropy generation rate depends on the slope of the gradient and several other parameters. Instead of having to specify all of these details when we wish to focus on the general process, we might choose to idealize the heat transfer as occurring reversibly. Although this condition can never be satisfied exactly in reality (since all spontaneous processes are driven by a nonzero gradient), it simplifies the entropy calculation to include just two parameters: the temperature and the amount of energy transferred.
A: That's right, it doesn't always hold true, what you need is the equation of entropy to define a state that includes both reversible and irrevesible terms. The equation you seek is one which is called the entropy production 
https://en.wikipedia.org/wiki/Entropy_production
A: Firstly to address your last comment. The reversibility being so as to satisfy the heat change being slow is a sort of cyclic argument, because if it wasn’t (I.e. there was a finite temperature difference) then your reaction ISNT reversible. 
Now to speak of the generalities, the thing is that entropy is a state function. So if you have two chemicals, $X_1$ and $X_2$ being the reactants and products respectively, it doesn’t matter what path you take as long as that’s your start and end. You could go via another chemical $X_3$ but as long as you get from $X_1$ to $X_3$ the answer is the same. 
So now that we have that, how can it be made useful? Well it’d be pretty convenient if we could choose a path that is relatively simple to calculate, or at least doesn’t require us to worry about all the physical worries such as friction. The path that does this is the reversible path (this is also kind of cyclic as classical entropy is defined in terms of reversible paths). So why do we do it reversibly? Mostly because it’s convenient, it removes a lot of practical worries, and lets us do calculations in terms of data we can get from books and such.
