JavaScript Quotes

8,660 ratings, 4.23 average rating, 556 reviews
Open Preview
JavaScript Quotes
Showing 1-29 of 29
“Computer programs are the most complex things that humans make.”
― JavaScript: The Good Parts
― JavaScript: The Good Parts
“We see a lot of feature-driven product design in which the cost of features is not properly accounted. Features can have a negative value to customers because they make the products more difficult to understand and use. We are finding that people like products that just work. It turns out that designs that just work are much harder to produce that designs that assemble long lists of features.”
― JavaScript: The Good Parts
― JavaScript: The Good Parts
“Generally, the craft of programming is the factoring of a set of requirements into a a set of functions and data structures.”
― JavaScript: The Good Parts
― JavaScript: The Good Parts
“Obsolete comments are worse than no comments.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“If we offend, it is with our good will That you should think, we come not to offend, But with good will. To show our simple skill, That is the true beginning of our end.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Quality was not a motivating concern in the design, implementation, or standardization of JavaScript. That puts a greater burden on the users of the language to resist the language's weaknesses.”
― JavaScript: The Good Parts
― JavaScript: The Good Parts
“Fortunately, JavaScript has some extraordinarily good parts. In JavaScript, there is a beautiful, elegant, highly expressive language that is buried under a steaming pile of good intentions and blunders.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“JavaScript, being a loosely typed language, never casts. The lineage of an object is irrelevant. What matters about an object is what it can do, not what it is descended from.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Some languages offer the tail recursion optimization. This means that if a function returns the result of invoking itself recursively, then the invocation is replaced with a loop, which can significantly speed things up. Unfortunately, JavaScript does not currently provide tail recursion optimization. Functions that recurse very deeply can fail by exhausting the return stack:”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“There are four patterns of invocation in JavaScript: the method invocation pattern, the function invocation pattern, the constructor invocation pattern, and the apply invocation pattern.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Objects are passed around by reference. They are never copied:”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Attempting to retrieve values from undefined will throw a TypeError exception. This can be guarded against with the && operator: flight.equipment // undefined flight.equipment.model // throw "TypeError" flight.equipment && flight.equipment.model // undefined”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“The || operator can be used to fill in default values: var middle = stooge["middle-name"] || "(none)"; var status = flight.status || "unknown";”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“A property value can be any JavaScript value except for undefined.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“If a return expression is not specified, then the return value will be undefined.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“a return expression is not specified, then the return value will be undefined.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“The try statement executes a block and catches any exceptions that were thrown by the block. The catch clause defines a new variable that will receive the exception object. The throw statement raises an exception. If the throw statement is in a try block, then control goes to the catch clause. Otherwise, the function invocation is abandoned, and control goes to the catch clause of the try in the calling function. The expression is usually an object literal containing a name property and a message property. The catcher of the exception can use that information to determine what to do.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“The other form (called for in) enumerates the property names (or keys) of an object. On each iteration, another property name string from the object is assigned to the variable.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Here are the falsy values: false null undefined The empty string '' The number 0 The number NaN All other values are truthy, including true, the string 'false', and all objects.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“The switch, while, for, and do statements are allowed to have an optional label prefix that interacts with the break statement.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“When used inside of a function, the var statement defines the function’s private variables.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Numbers JavaScript has a single number type. Internally, it is represented as 64-bit floating point, the same as Java’s double. Unlike most other programming languages, there is no separate integer type, so 1 and 1.0 are the same value. This is a significant convenience because problems of overflow in short integers are completely avoided, and all you need to know about a number is that it is a number. A large class of numeric type errors is avoided.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Names A name is a letter optionally followed by one or more letters, digits, or underbars. A name cannot be one of these reserved words: abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for function goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var volatile void while with Most of the reserved words in this list are not used in the language. The list does not include some words that should have been reserved but were not, such as undefined, NaN, and Infinity. It is not permitted to name a variable or parameter with a reserved word. Worse, it is not permitted to use a reserved word as the name of an object property in an object literal or following a dot in a refinement. Names are used for statements, variables, parameters, property names, operators, and labels.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“The best thing about JavaScript is its implementation of functions. It got almost everything right. But, as you should expect with JavaScript, it didn’t get everything right.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“suppress empty strings in the output array when the separator is a regular expression: var f = '|a|b|c|'.split(/\|/); // f is ['a', 'b', 'c'] on some systems, and // f is ['', 'a', 'b', 'c', ''] on others string.substring(start, end ) The substring method is the same as the slice method except that it doesn’t handle the adjustment for negative parameters. There is no reason to use the substring method. Use slice instead. string.toLocaleLowerCase( ) The toLocaleLowerCase method produces a new string that is made by converting this string to lowercase using the rules for the locale. This is primarily for the benefit of Turkish because in that language `I’ converts to 1”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“Few classical programmers found prototypal inheritance to be acceptable, and classically inspired syntax obscures the language’s true prototypal nature. It is the worst of both worlds.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“JavaScript is a language with more than its share of bad parts.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts
“undefined and NaN are not constants. They are global variables, and you can change their values. That should not be possible, and yet it is. Don’t do it.”
― JavaScript: The Good Parts: The Good Parts
― JavaScript: The Good Parts: The Good Parts