Best software reuse books according to redditors
We found 15 Reddit comments discussing the best software reuse books. We ranked the 1 resulting product by number of redditors who mentioned them. Here are the top 20.
We found 15 Reddit comments discussing the best software reuse books. We ranked the 1 resulting product by number of redditors who mentioned them. Here are the top 20.
Chris Wellons blog series is good for minimalist C library design, and he has excellent examples on his Github too: https://nullprogram.com/blog/2018/06/10/
For a more opaque approach, check out: https://www.amazon.com/Interfaces-Implementations-Techniques-Creating-Reusable/dp/0201498413
C Interfaces and Implementations has some decent advice for designing C programs. This is also a skill which you 'll develop with time (e.g. over your entire career) so don't worry too much about figuring it out immediately; it requires experience. As you work on various projects you'll get a sense for what works and what doesn't so that over time you'll have developed strategies for solving particular types of problems.
OOP concepts are still valid even though C may not have ways to necessarily implement them within the language proper. Object-Oriented Software Construction is a fantastic book for learning OOP concepts. As your C experience grows, you'll begin to see ways of implementing some of those design strategies with C, even though it's not an OO language.
Knowing when to use what type of data structure can also aid in simplifying your code base. The standard book for this is CLRS, but for C specific implementations and advice, see Algorithms in C.
You absolutely should make it modular, it just takes some different techniques to do it. C Interfaces and Implementations covers that topic in some depth.
If you're a Python programmer and you want to learn C, the best way to get started is by writing C extensions for Python. Find a C library that looks interesting and wire it up to CPython.
A baby step towards doing this is to use an FFI, like Python ctypes or Ruby/DL. You'll be working with raw memory and C function calls, but you'll be writing Python. Try to port your FFI-driven extension to native C.
I don't recommend just grabbing K&R and plowing through it. It's a great book but you're not going to retain anything by reading and then trying to write out the example programs. C didn't click for me until I had real projects to work on.
My recommended book is C Interfaces and Implementations (CII). What you're going to miss in C, right away, is the lack of a "list" or "array" type like you get in Python. CII will give you the list and the dict back, and, more importantly, show you how to structure your C code professionally and idiomatically.
Right. But don't be so quick to judge. =)
The issue is that there isn't anything much better out there. A lot of the issues with teaching C is C itself.
C it a very simple language, maybe too simple. A lot of the safety in C is difficult because C doesn't give you anything to get that right. The solution to this is being very good at it, know what you're doing and avoid the problems. Modularity barely is possible in C (it is only through simple means). Dynamicity is a pain. All of these things that other languages simply support out of the box, you have to go through major hops in C so you get them.
From what I understand, most uses of C today only exist when nothing else is applicable. That is, when they really need the sort of benefits you get from using C, because the language itself isn't that great.
You could write whole books on getting modularity right in C, on getting dynamicity right in C, on getting security right in C, and so forth. And in fact there are:
It goes on and on and on. The C standard library is extremely thin (in comparison to everything out there). How can K&R2 teach you how to write highly sophisticated programs if the most advanced stuff in the standard library is sorting? I'm being a bit simplistic in this argument, but it's not so much distant from the truth.
I have a several friends who find Test-driven Development to be really helpful for shaping their ideas into code. In general you'll need to break down the problem into smaller pieces, and TDD can help not only in realizing what those pieces need to be, but it also provides a method of ensuring that your code has accomplished what you want.
One of my favorite lessons from this sub is that complexity should stem from the coupling of simple parts. This isn't always straightforward. Many times it's easy to create a monolithic myProject.c, a single struct, or only a handful of functions to get the result you want. This isn't, strictly speaking, wrong but it is generally seen as bad practice. This is because when you have to maintain long term projects you want to have changes to one portion affect the others as little as possible; you should never have to rewrite the whole program in order to accommodate a change to a single part.
There aren't exactly hard and fast rules to determine the best process for modular design, but practicing on smaller projects is a good start. If you're looking for more specific "best practices" I've found C Interfaces and Implementations by David Hanson to be a really nice guide for some particularly common problems.
As for your specific project I think it would help you to consider the mechanics of TicTacToe as a game, and how you can change them while still keeping it familiar. For instance, my first thoughts are:
Now what I'm getting at here is that for the purposes of learning best practice it could help to design the program to allow for different rules, changing individual parts without it requiring a complete overhaul. If you can build it to change these things without recompilation so much the better. In general I look at this method as an analogous measure of scalability; can the program handle an increased load, how much of one, and how readily will it handle it. In allowing for modular rule changes you'll build a modular project.
As a final note, bear in mind that there is a limit to modularity. Eventually trying to make a program handle every eventuality can be paralyzing. Learning where the limit is and what you feel you can handle is almost purely a matter of experience, but I think the most important thing is to never let the scale of your project deter you from completing it. You control how the program is designed so ultimately it's your decision, and if that means just sitting down and writing out something that works so be it. The perfect is the enemy of the good.
I hope that helps.
Do you mean "C Interfaces and Implementations: Techniques for Creating Reusable Software by David R. Hanson"?
Or perhaps "C Programming: A Modern Approach, 2nd Edition by K. N. King"?
Kilo, A Text Editor
Build your own Lisp introduction to C
Architecture of Open Source Applications Not sure which are in C
Lion's Commentary on Unix pre-K&R C
Compiler Design in C some low-level stuff
C Interfaces and Implementations (amazon link)
I haven't read any of these, but they're highly recommended.
So I found the book C Interfaces and Implementations, which looks pretty good. Do you have any other recommendations for design pattern books?
I have been following the Linux kernel style guide for a while and I am pretty happy with it. I have skimmed some random kernel code a few times but always felt actually diving in and seriously reading it would require a big time commitment, maybe better to start with something smaller first like Contiki...
First note that Career/Job/Market is quite different from Knowledge/Intellectual satisfaction. So you have to keep "earning money" separate from "gaining knowledge" but do both parallely. If you are one of the lucky few who has both aligned in a particular job, you have got it made. Mostly that is never the case and hence you have to work on your Motivation/Enthusiasm and keep hammering away at the difficult subjects. There are no shortcuts :-)
I prefer Books to the Internet for study since they are more coherent and less distracting, allowing you to focus better on a subject. Unless newer editions are reqd. buy used/older editions to save money and build a large library. So here is a selection from my library (in no particular order);
Besides what has been mentioned, these two are also good:
: teaches good design practices in C.
You don't need a school for this.
Low Level Programming Languages
For some Assembly
Software Reverse Engineering
Nostarch press/Wiley has books on this, plenty of defcon lectures. Watch 'Trolling with Math' as a way to defend against reverse engineering.
Operating System Theory
Also look up MIT classes 6.004 and 6.033 they cover all this in detail. Can find vids online of record lectures, open courseware assignments and lecture notes, ect.
Networking
Cellular and Mobile Communications
Discrete Math
Overview of Cyber Defense
Security Fundamental Principles (i.e., “First Principles”)
Above material covers this
Vulnerabilities
Legal
No idea