Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#7446 closed bug (wontfix)

prepend and prependTo methods not accurate as method descriptors

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

Description

"Prepend" isn't a word in any real dictionary, it is jargon. Should consider using the proper term of 'prefix' and 'prefixTo'

This is confusing to people who don't know what prepend is, because it isn't a word in the english language.

http://www.merriam-webster.com/dictionary/prepend

Change History (9)

comment:1 Changed 13 years ago by snover

Resolution: wontfix
Status: newclosed

Ajax isn’t a “word in any real dictionary” either. Deal with it. prepend at dictionary.com

comment:2 Changed 13 years ago by anonymous

Many programming style guides recommend that method names begin with a strong action verb. As prepend is in fact jargon, it is not a strong action verb that is easily understood. Even in this comment field the word is underlined by the browser because it does not recognize it as part of the English language.

The example given above that "Ajax isn't a 'word in any real dictionary' either" is not true, as ajax exists in nearly every English dictionary.

Its meaning is not the one usually referenced, however it is also not a method and therefor use of a strong action verb isn't recommended.

These tickets are here to make jquery a better product, not for facepalming. the bug should be valid regardless of snover's impudence and ignorance.

comment:3 Changed 13 years ago by SlexAxton

1) It's not a bug. It'd be an enhancement, if it was anything. (Which it isn't)

2) It's a backwards incompatible api change - something _everyone_ loves.

3) 'ajax' is a function, though it's not a it a 'strong verb' or even a 'verb' for that matter in your definition.

4) In 2 years of jQuery support on the jQuery IRC, I have never once seen someone be confused by this function.

5) prefix would not be the correct word. It implies _before_ not 'add as the first element of' like prepend implies.

6) Regardless of the purpose of the bug tracker, you are not welcome to post insults to the people who triage the bugs here (or anyone for that matter). That's cowardly, uncalled for, and rude. Show some respect.

Last edited 13 years ago by SlexAxton (previous) (diff)

comment:4 Changed 13 years ago by paul.irish

7) is my favorite number.

comment:5 Changed 13 years ago by ajpiano

Just because something doesn't show up in Merriam Webster's abridged dictionary does not mean it is "not a word." Prepend is a perfectly reasonable backformation from append, and has been in use in computing circles for some time. Outside of its meaning in a computing context, it is definitely a word, one that means "to consider, to ponder."

Languages and APIs are full of terms that are borrowed from English and repurposed. "Explode" in PHP does not cause a string to detonate. "Grep" is not, in fact, a word. "Ajax" does not have a standard meaning in English except as a given name.

The bug tracker is indeed for identifying problems and ideas that will make jQuery better. Making an API change that would either be backwards-incompatible or require legacy support to not break people's existing code because one anonymous user shows up and decides to play ticky-tack prescriptivist is not one such change.

Last edited 13 years ago by ajpiano (previous) (diff)

comment:6 Changed 13 years ago by nocknock@…

Can't believe this showed up. Me and my buddy had a discussion about this maybe 3 years ago. In our own programming we use prefix. Once our boss used the word prepend to describe what to do and I responded "Shouldn't I first prepopulate the data?" Of course he said he wasn't sure.

Bottom line is we try not to use words imaginitized by others, like prepopulate (just use populate), its just good strategery. We don't want jargonized words snuck into our codebase.

I get why it's wrong to use prepend, but should it be changed? Probably not, but a good lesson may be to stick to common words that can be looked up in a standard dictionary and everyone knows (not just seasoned programmers) when defining methods. Also, stops all the squabbling.

comment:7 Changed 11 years ago by gibson042

#12297 is a duplicate of this ticket.

comment:8 Changed 11 years ago by anonymous

The way to make it backwards compatible is 1) Copy it to a new method called prefix 2) Mark prepend as deprecated 3) Call prefix from prepend

comment:9 Changed 11 years ago by anonymous

Surely when it would be changed to "prefix" people start complaining it is not consistent with "append".

That said, if you want it yourself just add these two little lines to your file:

$.fn.prefix = $.fn.prepend;
$.fn.prefixTo = $.fn.prependTo;

I don't think the advantages of changing it in core weigh up against the disadvantages.

Note: See TracTickets for help on using tickets.