348 reputation
19
bio website fortran.blogspot.com
location London, United Kingdom
age 33
visits member for 3 years, 7 months
seen Feb 2 at 19:43

general purpose developer


Apr
29
awarded  Autobiographer
Feb
27
revised How can you explain “beautiful code” to a non-programmer?
added 333 characters in body
Feb
27
awarded  Informed
Feb
27
awarded  Caucus
Oct
20
awarded  Yearling
Dec
20
awarded  Scholar
Dec
14
awarded  Student
Dec
8
answered How can you explain “beautiful code” to a non-programmer?
Nov
23
comment best and most used algorithm for finding the primality of given positive number
looking up can be slow if the table is big enough to need to be paged out ;-)
Nov
21
answered best and most used algorithm for finding the primality of given positive number
Nov
8
answered Should a programmer fix someone else's failed build?
Nov
8
awarded  Commentator
Oct
22
comment Should I reuse variables?
of course, an optimized build is not very useful for debugging! but in any case you still have the option of using a debug build... And when you have the debugger attached, you don't need to go step by step from the beginning of a function to see how the variables change, because they don't! :-D
Oct
21
comment What is the purpose of arrays in C, when pointers could have done the job?
Arrays are contiguous memory created on the stack -> An array does not have to be necessarily on the stack. It can be on the static data segment.
Oct
21
answered Should I reuse variables?
Oct
21
awarded  Supporter
Oct
21
comment What is the purpose of arrays in C, when pointers could have done the job?
why having compound expressions like x = a + b * 2; when you could achieve the same with a sequence of simple expressions like x = b; x*=2; x+=a;?
Oct
21
comment What is the purpose of arrays in C, when pointers could have done the job?
I don't follow you. What has to do the instruction set with all of this? The op was asking what things you could do with arrays and not with pointers, and declaring a struct with a fixed size array cannot be emulated with pointers. About multidimensional arrays, of course you can have just a chunk of memory and calculate the index of cell i,j by i*cols+j, but I think not having to do it alone is a reason good enough to justify the existence of array types.
Oct
21
comment Why should I know concurrent programming?
@ObscureRobot twice as funny! (the explanation wasn't needed :-p)
Oct
21
comment What is the purpose of arrays in C, when pointers could have done the job?
@sylvanaar and by the way, declaring structures does not generate any kind of assembly code, what you could see is that accessing the float field is done with a different offset (in case that 2*sizeof(int) is not the same as sizeof(*int) that could be the case)