Resourceful Code Reuse

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Reusing well-written, well-debugged, and well-tested code improves productivity, code quality, and software configurability and relieves pressure on software developers. When you organize your code into self-contained modular units, you can use them as building blocks for your future projects and share them with other programmers, if needed. Understand the benefits and downsides of seven code reuse models so you can confidently reuse code at any development stage. Create static and dynamic libraries in C and Python, two of the most popular modern programming languages. Adapt your code for the real world: deploy shared functions remotely and build software that accesses them using remote procedure calls.

Avoid the drawbacks and harness the benefits associated with seven code reuse models. Create static and dynamic libraries in C and Python, deploy shared functions remotely, and build software that makes intelligent use of remote procedure calls. In no time at all, you'll develop the confidence to reuse code at any stage of real-world development.

This one-stop solution covers the complete build cycle: editing, compiling, linking, and running a ready program. Apply Linux/macOS power software development tools, such as ld, ldd, ranlib, and nm, to construct and explore state-of-the-art function libraries in C that could be linked with application-specific code either permanently or for the duration of execution. Learn why Python has modules for reuse and how they differ from C object files and libraries. Understand the risks and other negative implications of sharing and reuse. As a bonus, distill the dependencies between your project's components and automate and optimize your build process with the "make" utility.

Whether you are an amateur coder or an experienced developer, become a more productive and resourceful programmer by reusing previously written code.

What You Need:

To compile and run the C examples mentioned in the book, you need a decent C compiler (GCC is the best, but Intel and Microsoft would probably work, too) and a set of C development tools: maker (make), linker (ld), file, strip, ldd, and ranlib. Again, the GNU development toolset works marvels; other toolsets may or may not work. All examples in the book have been tested on a Linux computer but will most likely work on macOS. For the Python examples, a Python-3.x interpreter is all you want. No third-party modules are required.

Author(s): Dmitry Zinoviev
Edition: 1
Publisher: Pragmatic Bookshelf
Year: 2021

Language: English
Pages: 142
Tags: Code Reuse; Make; ld; ldd; ranlib; nm; static libraries; dynamic libraries;

Cover
Table of Contents
Acknowledgments
Preface
About the Reader
About the Book
About the Software
Introduction: Why Reuse Code?
C vs. Python
Running Example
1. Reuse Code at Compile Time (C and Python)
Arranging Source and Header Files (the C Way)
Modularizing Code (the Python Way)
2. Reuse Code at Link Time (C Only)
Compiling Object Files
Building Static Libraries
Building Dynamic Libraries
3. Reuse Code at Runtime (C and Python)
Harnessing Dynamic Loading
Getting a Taste of Remote Procedure Calls
Bibliography