1

Forms are nothing new to you, since they are built using HTML. However, not all forms are the same, especially when a JavaScript developer creates the form. JavaScript can make a form come alive, letting it interact dynamically with form elements while information is being entered into the form.

You experience this whenever the browser automatically changes settings on the form based on your selection from a drop-down list. Behind the scenes, the browser calls a JavaScript when the drop-down list selection changes. The JavaScript reads the selection and determines the settings for the other form elements. You’ll learn how to perform this and other feats of JavaScript magic in this chapter.

Does a JavaScript used like that with an indefinite article mean that it is just a snippet of JavaScript code?

4
  • I agree with you. I think it refers to a part of code or a JS function.
    – user1513
    Commented May 19, 2014 at 15:10
  • I think the author thought of that "a JavaScript" as a script written in JavaScript. Commented May 19, 2014 at 15:10
  • Yes it means a JavaScript script, or piece of code, it is generic because given the circumstance it can be anything. It is just how programmers speak, sort of. Plus saying JavaScript Script, sounds a bit odd. Or even if you say it like Damkerng "a script written in JavaScript", it is too long and you miss the point. That is why you will always see a JavaScript and not the other sentences.
    – Dzyann
    Commented May 19, 2014 at 18:05
  • 2
    Programmers don't generally say "a JavaScript". (Clearly some do, but it sounds strange!)
    – user230
    Commented May 19, 2014 at 18:34

2 Answers 2

3

We do not customarily refer to pieces of text by their language— a Petrarch sonnet is not an Italian, a Vedic hymn is not a Sanskrit, and so on. Traditionally, programming languages are treated as analogues to their spoken counterparts, and in the same way we would not traditionally say a Ruby or a Python to speak of a Ruby gem or a a Python script.

In casual conversation, however, there is a strong tendency to abbreviate. Instead of saying I watched an episode of Family Guy last night, I might lazily say I watched a Family Guy last night, if everyone in my audience understood that Family Guy refers to a television show. And so it is that I hear developers call a JavaScript, launch a JUnit, or open a WebEx in the same way. I suspect JavaScript in particular may be prone to this treatment; snippets of it may be scattered throughout markup, and a JavaScript script is abrupt to pronounce and sounds repetitive, both lending themselves to the abbreviated usage.

In writing, I would advise against such abbreviations due to the risk of ambiguity. After all, to a DBA, run a SQL means execute a SQL statement, but to a server admin, it means run another instance of the SQL daemon. Better to expend a few more bytes and be clear: call a JavaScript function, launch a JUnit test, open a WebEx meeting, and so on.

2
0

If camel case is used there, it makes the word a proper noun and thus it should not take the indefinite article.

The author means a script written in JavaScript as Damkerng said and it should not take an article there. Also note that books on programming take a little bit of liberty with grammar as compared to literary works. I've noticed that.

2
  • 1
    Indefinite articles are certainly used with proper nouns. I can drive an Aston, marry a Custis, or write to a Beatle, and while I may not be a Barry England or a John Lawler, I'm certain those uses are conventional.
    – choster
    Commented May 19, 2014 at 19:33
  • 1
    @choster Indefinite articles can be used with a proper noun, but in doing so, syntactically turns them into a common noun with uncommon orthography.
    – jimsug
    Commented May 19, 2014 at 22:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .