Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I recently had some code I wrote a year ago fail because someone linked my code to

http://code.jquery.com/jquery-latest.js

In the latest version, jquery had deprecated/replaced a function.

Nice to have a dynamically updated version but my code isn't going to change, it's going to break. Is there any reason to use jquery-latest?

share|improve this question
1  
Are you asking in general if you should use the latest version of Jquery or for a specific reason for using the latest version of Jquery? There could be different answers depending. –  Akira71 Jan 22 '13 at 15:38
    
I don't know how I can make it any clearer, the problem is linking to that specific file, jquery-latest which will always be the latest version, yet my code isn't so will eventually break. So why does it exist? –  jim smith Jan 22 '13 at 15:43
1  
Because you will benefit from behind the scene updates, could be performance or bug-related. –  Max Jan 22 '13 at 15:47
    
@jimsmith Just because your code breaks doesn't mean everyone's will. Many people like getting the most recent updates to the jquery file (as max said there could be performance improvements and bugfixes). I'd imagine breaking changes with jquery are rare (such as a function being deprecated). –  Mansfield Jan 22 '13 at 15:50

1 Answer 1

up vote 8 down vote accepted

"Latest" could be useful during initial development to keep up with the most recent changes. jQuery does provide feature updates relatively often. Expect your code using it to break. When you release your project you should support, reference, and document a specific jQuery version. Typically it's safe to reference a minor version and support revision changes since the interfaces won't change (e.g. 1.9.x).

share|improve this answer
    
great answer thank you –  jim smith Jan 22 '13 at 15:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.