Do you have to know the PARTICULAR computers hardware for C programming?

I remember our shop standards on the old COBOL-68 compiler wouldn’t let us use a Compute statement.

The bosses had used an compiler option to display the generated assembly code and linkage map.

I never saw it. But apparently
Compute Result-1 = (x + y) / z.

Required more instructional code than
Add x + y giving tw.
Divide z into tw giving Result-1 rounded.

It was strictly enforced ban until we upgraded the compiler to COBOL-74.

It all came down to the efficiency of the compiler and hardware resources.

Compute was introduced in COBOL-68 and wasn’t trusted by the managers.

Evaluate came in COBOL-74 and that was allowed. I use Case statements a lot.

Realistically, all tables are fixed length in C. Either you’ve created an array of fixed length text buffers or you’ve got an array of fixed length pointers (sizeof(void*)). If you’ve done the latter then you’re using malloc instead of “new” to insert a string. Not really a great divergence.

If you understand memory layout, it’s really no difference either way. If you don’t then, yes, Python is going to be better. But then you’ll get into discussions about closures and you’re right back to needing to understand memory layout.

Most code, in any language, is a simple loop and some if-else statements to tell a library to do something. In C, you need to remember to clean up everything after you’re done with it but, outside of that, there’s generally not too big a difference between it and other languages.

Once you start dealing with closure mechanisms, the storage of 3D arrays, etc. you’re always better off to understand all the things that C brings to the top level of the code and forces you to think about.

If nothing else, it’s good to be able to be an effective C coder (just as it’s good to be able to be an effective assembly language coder). Whether to actually code in it, in production code… Generally the answer is no, because most programmers struggle just to do some simple single layer loops with the occasional if-else block. You’re just creating something that’s a dense block of mystery to all who come after you.

Job security is better attained by being able to get Junior programmers to do something useful than by being able to live as the troll under the bridge of unmaintainable code blocks.

3d tables require very strict variable names to keep the code maintainable.

I inherited an old program. The programmer had used Z as his table number.

I spent days in the debugger examining Z and trying to understand WTH the numbers in table 4 represented. Then 5 etc.

He had a loop incrementing or decrement Z based on logic from the data. It was a Statistical analysis. Numbers out of balance.

I rewrote it in SPSS.