On Mon, 25 May 2009, Vitaliy wrote: > Tamas Rudnai wrote: > > As they say the software developer's best friend is the Ctrl+C - Ctrl+V... > > Taken literally, this is actually considered a big no-no. :) "Ctrl-C, > Ctrl-V" violates a fundamental rule of programming: "one rule, one place." > > > > I have never considered as a reusable code of using libraries though. > > Interesting approach. > > We're finding that a majority (I'd say, 85%+) of the code that we created, > can be thought of as "library code". The reason for this is that when you > treat your modules as objects, it happens naturally. After all, "library" > and "reusable code" are synonyms. libraries, bloat, long hours debugging are "synonyms" :-) I see we're chasing unicorns again. I remember one time I worked for a company where it was deamed expediant to purchase a comms library rather than write it in house. We used said comms library, tested the resultant system and shipped it. We ended up with lots of egg on our collective face when the system mysteriously crashed a few days after installation. Turns out the library was at fault. It took weeks to track down the fault, much longer than if we'd written our own. How do you tell a client "actually the fault is with a SW component we bought in" - it doesn't wash. > > Most of the code in our currently active projects, is extern'ed from the > "library" repository. There are only a handful of files (including the > Initializer object) that have to be project-specific. I've worked with lots of companies where they insist on building everything as libraries with a minimal "main". What really gets to me about this approach is that it doesn't give you anything over simply linking object files together. This myth that "improving" a library automatically makes everyones code better is just complete BS. If anything it introduces bugs into tried and tested code - code which then needs to be completely retested by the person that didn't even make the changes to the library. I've seen many systems fall apart at the eleventh hour just as they're about to ship because someone fixed a bug in their code which had a detrimental effect on someone elses code. If you're talking about objects then presumably you're talking about C++ or Java. The overheads of using libraries are so bad C++ had to resort to "templates" - good luck debugging the mess that comes out of that when you try porting your code to a new compiler for a different system. And Java - I heard of a guy (worked with my brother - so pretty reliable source) that had to port Java to a system. He was tracing though the executable and was appauled to find that it took hundreds of millions of malloc calls just to print "hello world". Yeh sure you can get JIT (just in time compiling) for your Java program but how does that help when the libraries need to go through heavy duty memory management to achive trivial things. Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist