1 post • joined 4 Dec 2007
Copy and paste not as good as a good code library
The problem with a lot of code use is that it promotes BAD programming. I copy it from here, and paste it in this program and that program and that program and pretty soon I have lots of code that does the same thing being maintained in 20 different places.
Code Libraries are far better than this cut and paste mentality. The C Runtime Library made things easy to port, easy to use and in general help progress the art of computer programming way more than this arbitrary scrapbook of code you can paste from.
.NET and Java have almost gone too far the other direction with such a thick book of code that you don't have to invent much to do simple things (image manip, crypto, ....) but you need an encyclopedic brain to remember which package it is in.
We use a few core libraries in our development work and when we add functionality to one app that might be useful in the other, we put it in one of those core libraries:
WinExtensions - Thing Win32 should have had but didn't get
ImageCore - Things to do with Imaging
Generic - Things that STL didn't include
Boost - Nuff said
XMLib - XML stuff that sits on top of xerces (convenience mostly)
By collecting our code into groups like this we don't need so much to copy and paste and we maintain the code (with unit tests) in ONE spot.
I think it would be better to work on taming the Java and .NET API beast (although that might not be possible) than trying to make a cut and paste beast like this would become.
Design Patterns..... Yea, that's it!
- NASA boffin: RIDDLE of odd BULGE FOUND on MOON is SOLVED
- Pic Mars rover 2020: Oxygen generation and 6 more amazing experiments
- Microsoft's Euro cloud darkens: US FEDS can dig into foreign servers
- Plug and PREY: Hackers reprogram USB drives to silently infect PCs
- Boffins spot weirder quantum capers as neutrons take the high road, spin takes the low