Topic on Talk:JQuery

Od1n (talkcontribs)

Short identifiers in JavaScript are scarce, and "$" is the "golden one". Maybe some future day, jQuery will be obsolete, and there will be willing to free the "$" identifier for a different resource.

That would be a needed but huge breaking change. Do some discussions or thoughts concerning this (I hope hypothetical for long) scenario exist?

Krinkle (talkcontribs)

Regardless of the future for jQuery in MediaWiki or its default shortcut, I would strongly advise against use of $ as variable name in any JavaScript program. While it's unfortunate jQuery used this shortcut originally, we can't change that (and technically this character is as valid as any other for use in a variable name). But I certainly would not recommend using it for your own code. Not now, not in the future, regardless of whether we use jQuery. There are plenty of other characters available, and you needn't be worried about the length of variable names – given compression and minification we apply.

Ciencia Al Poder (talkcontribs)

Nothing that I'm aware of. But I don't think you should worry about something that it's not going to break in the foreseeable future.