• Complain

Christopher Preschern - Fluent C: Principles, Practices, and Patterns

Here you can read online Christopher Preschern - Fluent C: Principles, Practices, and Patterns full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Sebastopol, CA, year: 2022, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Christopher Preschern Fluent C: Principles, Practices, and Patterns
  • Book:
    Fluent C: Principles, Practices, and Patterns
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2022
  • City:
    Sebastopol, CA
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Fluent C: Principles, Practices, and Patterns: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Fluent C: Principles, Practices, and Patterns" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Expert advice on C programming is hard to find. While much help is available for object-oriented programming languages, theres surprisingly little for the C language. With this hands-on guide, beginners and experienced C programmers alike will find guidance about design decisions, including how to apply them bit by bit to running code examples when building large-scale programs.

Christopher Preschern, a leading member of the design patterns community, answers questions such as how to structure C programs, cope with error handling, or design flexible interfaces. Whether youre looking for one particular pattern or an overview of design options for a specific topic, this book shows you how to implement hands-on design knowledge specifically for the C programming language.

Youll find design patterns for:

  • Error handling
  • Returning error information
  • Memory management
  • Returning data from C functions
  • Data lifetime and ownership
  • Flexible APIs
  • Flexible iterator interfaces
  • Organizing files in modular programs
  • Escaping #ifdef Hell

Christopher Preschern: author's other books


Who wrote Fluent C: Principles, Practices, and Patterns? Find out the surname, the name of the author of the book and a list of all author's works by series.

Fluent C: Principles, Practices, and Patterns — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Fluent C: Principles, Practices, and Patterns" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Fluent C by Christopher Preschern Copyright 2023 Christopher Preschern All - photo 1
Fluent C

by Christopher Preschern

Copyright 2023 Christopher Preschern. All rights reserved.

Printed in the United States of America.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (https://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.

  • Acquisitions Editor: Brian Guerin
  • Development Editor: Corbin Collins
  • Production Editor: Jonathon Owen
  • Copyeditor: Piper Editorial Consulting, LLC
  • Proofreader: Justin Billing
  • Indexer: Judith McConville
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Kate Dullea
  • October 2022: First Edition
Revision History for the First Edition
  • 2022-10-14: First Release

See https://oreilly.com/catalog/errata.csp?isbn=9781492097334 for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. Fluent C, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

The views expressed in this work are those of the author and do not represent the publishers views. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-492-09733-4

[LSI]

Preface

You picked up this book to move your programming skills one step forward. That is good, because youll definitely benefit from the hands-on knowledge provided in this book. If you have a lot of experience programming in C, youll learn the details of good design decisions and about their benefits and drawbacks. If you are fairly new to C programming, youll find guidance about design decisions, and youll see how these decisions are applied bit by bit to running code examples for building larger scale programs.

The book answers questions such as how to structure a C program, how to cope with error handling, or how to design flexible interfaces. As you learn more about C programming, questions often pop up, such as the following:

  • Should I return any error information I have?

  • Should I use the global variable errno to do that?

  • Should I have few functions with many parameters or the other way around?

  • How do I build a flexible interface?

  • How can I build basic things like an iterator?

For object-oriented languages, most of these questions are answered to a great extent by the Gang of Four book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Prentice Hall, 1997). Design patterns provide a programmer with best practices on how objects should interact and which object owns which other kinds of objects. Also, design patterns show how such objects can be grouped together.

However, for procedural programming languages like C, most of these design patterns cannot be implemented in the way described by the Gang of Four. There are no native object-oriented mechanisms in C. It is possible to emulate inheritance or polymorphism in the C programming language, but that might not be the first choice, because such emulation makes things unfamiliar for programmers who are used to programming C and are not used to programming with object-oriented languages like C++ and using concepts like inheritance and polymorphism. Such programmers may want to stick to their native C programming style that they are used to. However, with the native C programming style, not all object-oriented design patterns guidance is usable, or at least the specific implementation of the idea presented in a design pattern is not provided for non-object-oriented programming languages.

And that is where we stand: we want to program in C, but we cannot directly use most of the knowledge documented in design patterns. This book shows how to bridge this gap and implement hands-on design knowledge for the C programming language.

Why I Wrote This Book

Let me tell you why the knowledge gathered in this book turned out to be very important for me and why such knowledge is hard to find.

In school I learned C programming as my first programming language. Just like every new C programmer, I wondered why arrays start with index 0, and I first rather randomly tried out how to place the operators * and & in order to finally get the C pointer magic working.

At university I learned how C syntax actually works and how it translates to bits and bytes on the hardware. With that knowledge I was able to write small programs that worked very well. However, I still had trouble understanding why longer code looked the way it did, and I certainly wouldnt have come up with solutions like the following:

typedefstructINTERNAL_DRIVER_STRUCT*DRIVER_HANDLE;typedefvoid(*DriverSend_FP)(charbyte);typedefchar(*DriverReceive_FP)();typedefvoid(*DriverIOCTL_FP)(intioctl,void*context);structDriverFunctions{DriverSend_FPfpSend;DriverReceive_FPfpReceive;DriverIOCTL_FPfpIOCTL;};DRIVER_HANDLEdriverCreate(void*initArg,structDriverFunctionsf);voiddriverDestroy(DRIVER_HANDLEh);voidsendByte(DRIVER_HANDLEh,charbyte);charreceiveByte(DRIVER_HANDLEh);voiddriverIOCTL(DRIVER_HANDLEh,intioctl,void*context);

Looking at code like that prompted many questions:

  • Why have function pointers in the struct?

  • Why do the functions need that DRIVER_HANDLE?

  • What is an IOCTL, and why would I not have separate functions instead?

  • Why have explicit create and destroy functions?

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Fluent C: Principles, Practices, and Patterns»

Look at similar books to Fluent C: Principles, Practices, and Patterns. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Fluent C: Principles, Practices, and Patterns»

Discussion, reviews of the book Fluent C: Principles, Practices, and Patterns and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.