Reputation
13,667
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 33 63
Newest
 Guru
Impact
~482k people reached

Jul
26
awarded  Guru
Jul
25
awarded  Good Answer
Jul
25
awarded  Nice Answer
Jul
25
comment How do you explain a 'statement' in programming?
' If you have an if statement, does that mean nothing inside of it is a statement?' That's different, the defined syntax of an if statement is typically 'if' followed by a conditional followed by one or more statements. Neither the conditional nor the parameter list of a function can typically contain statements, though they can contain 'expressions'. Think if it this way, in English there are phrases that can either be a clause in a sentence, or stand alone as a sentence themselves, but you can't put a sentence as such inside a sentence.
Jul
25
revised How do you explain a 'statement' in programming?
edited body
Jul
25
comment How do you explain a 'statement' in programming?
See the edit to my answer.
Jul
25
revised How do you explain a 'statement' in programming?
added 352 characters in body
Jul
25
answered How do you explain a 'statement' in programming?
Jul
20
comment rand() gives same numbers again for a small range
Next, rand() is typically a linear congruential generator This isn't true on many platforms now. From the rand(3) man page of linux:" The versions of rand() and srand() in the Linux C Library use the same random number generator as random(3) and srandom(3), so the lower-order bits should be as random as the higher-order bits." Also, as @delnan points out, the quality of the PRNG isn't the real problem here.
Jul
17
answered Why isn't programming mobile apps more similar to programming desktop applications?
Jul
10
comment In C, how are functions accessible if they're not inline or called by #include?
@Volumetricsteve that's almost certainly the case, but keep in mind that compiling and linking are separate processes in C. If your code is referring to functions or datatypes defined in a different library, those will need to get declared in your program before it will compile. This is almost certainly happening via the include of some header file. Exactly where it's occuring may be obscured by nesting, For example, you include file "foo.h", which in turn includes "bar.h", which includes "png_magic.h", which provides the needed declarations.
Jul
10
revised In C, how are functions accessible if they're not inline or called by #include?
deleted 36 characters in body
Jul
10
answered In C, how are functions accessible if they're not inline or called by #include?
Jun
24
awarded  Nice Answer
Apr
27
comment Is it always a good idea to divide large classes into smaller ones?
What do you mean by "too many objects"? Do you have any objective standard for that judgement?
Apr
24
comment Why are floating point numbers used often in Science/Engineering?
@MichaelGrünewald, What you say is certainly true, but I think primarily of interest to mathematicians and their fellow travelers. The subtext of the original question is that many work-a-day programmers find floating point arithmetic baffling. I suspect this is because they mostly work with computations that can be made with perfect precision using integers from a finite range (think bookkeeping and inventory). Floating point arithmetic is confusing for them because they don't appreciate that they've entered a problem domain where perfect precision is impossible.
Apr
24
comment Why are floating point numbers used often in Science/Engineering?
@PaulChernoch, sure, but there is a performance cost to that. Nobody is going to re-write their finite element modeling package or their machine learning library to use a continued fraction representation or even arbitrary precision rationals because they can't afford the performance penalty. As I said in my answer, scientific computing is a trade-off among precision, range, and speed.
Apr
24
answered Is this a good game plan to become a fluent Java developer?
Mar
22
comment Where and when does firmware of a device run?
Firmware is a general category of storage. It just means data or code that is stored in a medium that is seldom changed. Most commonly its stored on a ROM (read only memory) chip. BIOS is a specific example of firmware: a ROM chip on the motherboard of a personal computer which contains a library of utility subroutines. You can see a typical list of the routines here: en.wikipedia.org/wiki/BIOS_interrupt_call. But it's just a memory chip, and the CPU has to do the actual processing.
Mar
21
comment Do bare computer systems (without OS installed) use (executable) files?
@ScottWhitlock, different kinds of memory run at different speeds. ROM is generally slow compared to dynamic RAM. If you are going to be referring to the contents of ROM a lot it makes sense to pay the one time cost of copying it into RAM.