Examples
The following JavaScript algorithm has a large number of redundant variables, unnecessary logic and inefficient string concatenation.
// Complex function TK2getImageHTML(size, zoom, sensor, markers) { var strFinalImage = ""; var strHTMLStart = 'The same logic can be stated more efficiently as follows:
// Simplified TK2.getImageHTML = function(size, zoom, sensor, markers) { var url = [ 'http://maps.google.com/maps/api/staticmap', '?center=', markers.latitude, ',', markers.longitude, '&size=', size, '&zoom=', zoom, '&sensor=', sensor ]; for (var i = 0; i < markers.length; i++) { url.push(markers.addMarker); } return 'Read more about this topic: Code Bloat
Famous quotes containing the word examples:
“No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.”
—André Breton (18961966)
“Histories are more full of examples of the fidelity of dogs than of friends.”
—Alexander Pope (16881744)
“There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.”
—Bernard Mandeville (16701733)