I am a bit new in SharePoint development. and read some articles and online tutorials.. but I can not get what are the main differences between:-
and is there a preferred method to be used over the other ?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
those are 2 different things. REST endpoints are being used to query and perform CRUD operations based on a list. similar to using any external APIs . and REST end point is based of the oData standards. while the CSOM is used to also query list data, and it is a way to do some client side programming on office 365 and APPs using client Context() and it is a method to replace the server side object module which is not available inside APPs and office 365..
For more info go here CSOM: https://msdn.microsoft.com/en-us/library/office/dn268594.aspx?f=255&MSPPError=-2147217396