If a dog takes a beating, it will remember that, will be affected by it, will suffer for it, long after the physical event has passed. Just like us. The question is whether a crab would remember getting a beating. That is the difference between pseudo-mechanical stimulus-response and learned behavior, and a being that is ‘sentient’.