About This Title

Pages: 64
Published: April 2021
ISBN: 9781680508208
In Print

Skill Level Meter

Resourceful Code Reuse

Write → Compile → Link → Run

by Dmitry Zinoviev

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.


About the Pragmatic Answers Series

Sometimes “right now” just isn’t soon enough. When you’re facing a hard deadline and need features that work and code that passes all the tests, there’s no time to hunt through forums and dubious blog posts hoping to stumble across a solution. You need accurate information from experts you trust. You need hands-on instruction that gets right to the point. You need Pragmatic Answers.

Ebook only and short (around 50 pages), the Pragmatic Answers Series gets you over the toughest hurdles in the blink of an eye.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $9.99 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal


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.

Resources

Releases:

  • P1.0 2021/04/27
  • B2.0 2021/03/17
  • B1.0 2021/02/22

Contents & Extracts

  • Preface
    • About the Reader
    • About the Book
    • About the Software
  • Introduction: Why Reuse Code?
    • C vs. Python
    • Running Example
  • Reuse Code at Compile Time (C and Python)
  • Reuse Code at Link Time (C Only)
    • Compiling Object Files
    • Building Static Libraries
    • Building Dynamic Libraries
  • Reuse Code at Runtime (C and Python)
    • Harnessing Dynamic Loading
    • Getting a Taste of Remote Procedure Calls

Author

Dmitry Zinoviev is a professor of Computer Science at Suffolk University in Boston and has a dual degree in Physics and Computer Science. He is passionate about C and Python programming, complex network analysis, computational social science, and digital humanities.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

  • mobi for Kindle readers

Get all eBook formats here for $9.99 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

Related Titles:

Skill Level Meter

About This Title

Pages: 64
Published: April 2021
ISBN: 9781680508208
Edition: 1
In Print