min-protocol / min

The MIN protocol specification and reference implementation
257 stars 88 forks source link

typedef struct coding #6

Closed Resonanz closed 7 years ago

Resonanz commented 7 years ago

Hi Ken, I have been trying to remember C coding from long ago, and came across this stuff on StackExchange:

http://stackoverflow.com/questions/252780/why-should-we-typedef-a-struct-so-often-in-c

I note that some commenters there are strongly against using "typedef struct" and consider it an abuse of the C programming language LOL. Even: "If I have to maintain your code, I will remove your typedef'd structs."

Not sure what you think about this. I just thought it might be useful to think about.

kentindell commented 7 years ago
  1. Well vi is definitely better than emacs. No, really. It just is.

  2. This C style is what they do in the Micropython firmware and that's where I first coded version 2.0 of MIN. The #1 rule of coding styles is to fit in with the project style. But I don't like it much as a style either so once you've confirmed it's working on your Arduino board I'll look at tidying it up.