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)
“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)