Feeds

Code scavenging goes formal

Careful what you consume

The essential guide to IT transformation

Scott Hackett at SlickEdit has blogged its time to update the time-honored practice of code scavenging. According to Hackett, taking a more formal approach could help to improve developer productivity.

He argues that, while software re-use has historically concentrated on higher level frameworks and larger objects, there are also potential benefits in using code scavenging to fulfill the smaller (and less glamorous) "bite-size tasks" that developers face every day.

Hackett makes some good points, but can scavenging for scraps really turn you into a master programmer, and is it possible - or even desirable - to institutionalize this "make-do" approach?

Code scavenging is seen as the most frequent and least complex way of re-using code and has been common practice at an informal level since programming first began. Programming is difficult to teach and most programmers learn their chops by looking at working code and using it as the basis for building their own programs. In other words, they "scavenge" the good bits and tweak them to a new purpose.

The term scavenging appears to have first surfaced as a formal concept in a 1992 paper by Charles Krueger of Carnegie Mellon University. It was tested by academics in the 1990s but rejected because it yielded few gains for a lot of effort.

According to Hackett, code scavenging is worth re-visiting because the Web makes it easier to find code and re-use it. He points to sites where massive amounts of existing code are available for potential scavenging such as Google code search, Sourceforge, Code Project, Microsoft's Codeplex, and O'Reilly's Code Search. Others include the Free Software Foundation (FSF), FreeVBcode.com, Freecountry and Freshmeat.

He accepts that there are a few problems with scavenging for "bite-size tasks" however. The tools to find code at this level do not yet exist and it is difficult to define and package small-scale code components so they are identifiable. You are unlikely to find what you want with a simple Web search

Techniques such as literate programming could possibly be used to create an appropriate syntax that makes small code components easier to define. But as programming guru Edsger Dijkstra pointed out many years ago, although mastery of language is just as important in good programming practice as mastery of logic and numeracy, it is not as common as it should be.

The biggest barrier to formal code scavenging, however, is the problem of trust. Programmers are, quite rightly, suspicious of code they did not create themselves and any scavenged artifacts will need thorough testing to ensure they do what they are supposed to do - and nothing else. This could be so time consuming as to negate any potential productivity gains.®

The essential guide to IT transformation

More from The Register

next story
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Mozilla's 'Tiles' ads debut in new Firefox nightlies
You can try turning them off and on again
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
Scratched PC-dispatch patch patched, hatched in batch rematch
Windows security update fixed after triggering blue screens (and screams) of death
This is how I set about making a fortune with my own startup
Would you leave your well-paid job to chase your dream?
prev story

Whitepapers

Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Advanced data protection for your virtualized environments
Find a natural fit for optimizing protection for the often resource-constrained data protection process found in virtual environments.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.