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:
“In the examples that I here bring in of what I have [read], heard, done or said, I have refrained from daring to alter even the smallest and most indifferent circumstances. My conscience falsifies not an iota; for my knowledge I cannot answer.”
—Michel de Montaigne (15331592)
“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)