Ask for feedback from professionally experienced C programmers #45
Replies: 2 comments 1 reply
-
|
I can comment a bit to get things going, but I'd love to hear from others on it. Regarding standards, there was a time a while ago when folks would point out if you used a post-C89 feature since it might not build on an older compiler, but that doesn't seem to happen much any more for any standard. My gut says that C99 is a common target nowadays, but the world has changed a lot since 2000 and I feel there's more keeping up-to-date with the newest compilers. Even if they're only coding for C99, the compiler could very likely be newer than that. I'm certain there are exceptions--a friend of mine works at a company where he's been trying to get them to upgrade for something ridiculous, like 10 years. I have to confess, though, the last time I was paid to write C on a large codebase was 15 years ago (I started learning C in 1991 according to the price tag on my copy of K&R2.) One thing I want to add to the reference section eventually is an indicator of what standard a function applies to so people know what they're getting into. And I build all the samples with |
Beta Was this translation helpful? Give feedback.
-
|
And the one thing I saw from coworkers (and myself--though we were all reasonably adept) was accidentally stepping into undefined behavior. There's a lot of that in C. In one case, I removed an unused local variable and it caused our completely-unrelated vector copy code to stop working in that function. A previous dev had been manually packing structs into a local char array. When I removed the local variable, it caused them to be misaligned on the stack and the vector copy required alignment. Changing the char array to an array of structs fixed it. (Unfortunately the employee had since left, so I was unable to ask why it was a char array instead of a more sensible struct array. But everything worked fine after the change.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey @beejjorgensen, I'm so glad you have enabled Discussions; things will get a lot better for your books.
As the title says, can we ask for professionally experienced C programmers for feedback on important topics we should know while learning C?
For example,
That's for a start.
Beta Was this translation helpful? Give feedback.
All reactions