Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

What is the "Command-query separation principle"?

+8 votes
asked Oct 21, 2015 in Fall 15-16 by Joseph Godfrey (100 points)

1 Answer

+3 votes
Best answer
This is the guideline that says ideally, any method that returns a value (a query) should not change the current object's state and any method that changes the current object's state (a command) should have a return type of void.
answered Oct 22, 2015 by Jeffrey Prior (100 points)
selected Oct 22, 2015 by Joseph Godfrey