K
Kevin Walzer
I'm trying to learn C. I have a fairly extensive background with C-based
scripting languages (Python,Tcl, others), so a great deal of C is
proving easy to pick up (control structures, functions, etc.). However,
what is *really* tripping me up is the entire process of identifying and
declaring variables at the beginning of your program, i.e.:
short int short_max = SHRT_MAX;
int integer_min = INT_MIN;
double double_max = DBL_MAX;
Generally, when developing a program in a scripting language, I follow
an interative development process, starting with some core
functionality, adding functions and variables as the program evolves. In
other words, I don't know in advance what variables I will need to declare.
With C, such an approach doesn't seem practical. You need to identify
some variables ahead of time just to have a program that will compile!
So, I'm wondering what approach seasoned C programmers use for larger
programs, i.e. ones larger than the simple single-function ones I'm
learning from my C textbook. Is there a design process that identifies
such things?
I hope this question about "mental models," getting into the C mindset,
isn't off-topic. TIA.
--Kevin
scripting languages (Python,Tcl, others), so a great deal of C is
proving easy to pick up (control structures, functions, etc.). However,
what is *really* tripping me up is the entire process of identifying and
declaring variables at the beginning of your program, i.e.:
short int short_max = SHRT_MAX;
int integer_min = INT_MIN;
double double_max = DBL_MAX;
Generally, when developing a program in a scripting language, I follow
an interative development process, starting with some core
functionality, adding functions and variables as the program evolves. In
other words, I don't know in advance what variables I will need to declare.
With C, such an approach doesn't seem practical. You need to identify
some variables ahead of time just to have a program that will compile!
So, I'm wondering what approach seasoned C programmers use for larger
programs, i.e. ones larger than the simple single-function ones I'm
learning from my C textbook. Is there a design process that identifies
such things?
I hope this question about "mental models," getting into the C mindset,
isn't off-topic. TIA.
--Kevin