Your question is a bit like asking what is the difference between your car's license plate and its odometer. A bar code is a means of identification. A linear encoder is a tool for measurement.
Do a search on your favorite search engine and you'll find plenty of articles on either subject.