- Feature Articles
-
CodeSOD
- Most Recent Articles
- Brushing Up
- Irritants Make Perls
- Crossly Joined
- My Identification
- Mr Number
- intint
- Empty Reasoning
- Zero Competence
-
Error'd
- Most Recent Articles
- Not Impossible
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
What happens when another David joins the team? Why is David spelled out (instead of Dave) but short Lisa is used (instead of Elizabeth)?
Ok jokes aside, it could also be Ruby, generating JSON into a global variable.
Admin
it can't be Ruby. That hame is already taken by Rubinho.
Admin
Because David prefers being David, while Lisa is actually Lisa and not Elizabeth? (Maybe you were thinking of Liza or Eliza???)
Admin
I think you should have written this instead:
Admin
I admit that this particular horror is new to me. At least the usual "final.js" and "final-final.js" and "really-final-3.js" nomenclature gives the appearance of a temporary stopgap that would be resolved on some grand (but never reached) End Day . . . whereas this reeks of being a permanent development policy.
I'm going to go wash my hands now.
Admin
So is "$" a valid character to start a variable name in JavaScript? I would have guessed not, but what do I know?
Admin
Not only is $ a valid character to start a variable with, it's actually not that unusual for $ itself to be a variable that's used. jQuery is the main use I know if, but I think there are others. (The jQuery library isn't doing anything special for its usual syntax, it just defines $ to be a function.)
Admin
If they ever get a programmer named "Jason"... <FWOOF head asplode>
Admin
I once saw an entire database for an HR/time tracking system named after Min, a Korean developer on the team. The database was named MinTest and until I met her, I thought it stood for something like "minimum test". 🤦♂️
Admin
Missed opportunity for an "Argh-onauts" pun
Admin
Good lord, I've written jQuery and used that syntax! Why have I forgotten that but still remember 6502 assembly codes?
Admin
I mean, it's real easy to learn and use jQuery without thinking hard about how what it's doing is defining $ as a function/object, and that really anyone could just define the symbol that way. They even support renaming it if needed, just in case you're using another library (or your own code) that uses $ for something else: https://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/
It's probably for the best that you've forgotten it though. :)
Admin
Today I learned that the Tesla "get your car to drive to you in a car park used to be called "Smart Summon". There's now a new version called "Actually Smart Summon".
From Ars Technica
Admin
It was (at one point) convention when using jQuery to prefix variables that represented jQuery objects (that is, variables that were returned by a jQuery call), to distinguish them from references to built-in JS types like
NodeList
orElement
.For example
var $foo = $('.bar');
as opposed tovar foo = document.querySelectorAll('.bar')
.Here's a Stack Overflow post from someone claiming to have originated that idea with a more thorough explanation.
None of that applies in this case, of course, where the variable apparently represents a string representation of a JSON object.