Reputation
13,250
Next privilege 15,000 Rep.
Protect questions
Badges
5 30 46
Newest
 Nice Answer
Impact
~417k people reached

Aug
19
comment When do you use float and when do you use double
"Modern computers" meaning Intel x86 processors. Some of the machines the Ancients used provided perfectly adequate precision with the basic float type. (The CDC 6600 used a 60-bit word, 48 bits of normalized floating-point mantissa, 12 bits of exponent. That's ALMOST what the x86 gives you for double precision.)
Aug
19
comment What is the ideal length of a method?
Cyclomatic complexity has been shown, on large quantities of real production code, to be VERY strongly correlated with raw SLOC, making the computation of cyclomatic complexity a total waste of time, energy, and clock cycles.
Aug
19
comment What is the ideal length of a method?
It isn't so much "get off my lawn" as an observation that I have seen a LOT of crap code over the years, and it seems to be getting WORSE.
Aug
15
comment Has there really not been one thing in the past 20 years that provided huge software development gains?
There seems to be an assumption underlying the question, that programmers would actually choose to use something that offered significant demonstrable benefits. Whether that assumption is justified seems to me to be very much in question.
Aug
13
comment Optimizing code by using registers, but what if they are not enough in number?
@randomA, the value may or may not reside in memory, depending on the target architecture, the compiler, the optimization level chosen, other code, and the phases of the moon, Mars, and Uranus. If the target machine has enough registers, and the compiler recognizes that there is no need to store the temporary in memory, it will just leave it in a register. NB: If you are on an x86 processor, the compiler essentially has no registers to play with, and everything must live in memory.
Aug
13
comment Optimizing code by using registers, but what if they are not enough in number?
@delnan The compiler is required to obey the semantic roadblocks. The programmer may know that the roadblock does not apply in this case, but there is no way, other than explicitly assigning a temporary, for the programmer to convey that knowledge to the compiler.
Aug
8
answered How to parse different number types with LALR(1)
Jul
30
answered Which language introduced the idea of private (hidden) variables?
Jul
28
answered What is the ideal length of a method?
Jul
28
comment Why was the first compiler written before the first interpreter?
McCarthy did not write the LISP interpreter. McCarthy invented a mathematical formalism. Steve Russell, one of the students in the MIT AI Lab at the time, realized he could write an interpreter to execute McCarthy's flights of fancy, and the rest is history.
Jul
27
comment If statements in “generic” assembly?
That's one way to do it. You really only need two, EQUALS and one of the unequal cases.
Jul
21
comment How to prove that following practices and industrial standards are profitable, and investment in refactoring are good
+1 for "Sometimes the grass really is markedly greener on the other side."
Jul
21
comment Why does C dominate in the embedded software market?
Correctness is always #1 on the list of requirements for a production program. Performance is #2. Far too often, programmers are not only willing but downright foaming-at-the-mouth eager to abandon enforcement of correctness in the name of performance.
Jul
18
comment Why are floats called “real numbers” in some languages?
I think you have the question backwards. At a time when most of the existing languages were using "real" to mean floating-point (as opposed to integer), C chose to use "float" instead of "real". Your question could just as easily, and more correctly IMHO, be stated as "Why does C (and its derivatives) use "float" instead of "real" to denote (machine-approximate, i.e., floating-point) real numbers?".
Jul
18
comment Why does C dominate in the embedded software market?
@dan04, in the vast majority of cases, that wasn't actually a problem. A 6DOF simulation group at Texas Instruments Defense Systems and Electronics Group did a little experiment in about 1988. Up until then, they'd done all their simulations in FORTRAN. They tried writing one in PASCAL, to see how bad it would hurt. They discovered that PASCAL gave them a small performance hit, but the increase in reliability and ease of debugging MORE than made up for it. Bluntly, they found that PASCAL's strong type checking was a GOOD thing. (And yes, they were doing arrays.)
Jul
17
comment Why does C have no competitors in low level stuff?
Ada is a lot pickier than C when it comes to doing things that are likely to result in you shooting yourself in the foot if you do it wrong. C lets you do it. Ada insists that you tell her that you INTEND to blow your foot to smithereens.
Jul
17
comment Why does C dominate in the embedded software market?
Don't underestimate the power of inertia and sloth. There were a LOT of "programmers" who screamed bloody murder about the mandatory strong type checking in PASCAL, then ate their broccoli and discovered it tasted pretty good in C++. (There are also some interesting anecdotes about guys forced to use Ada who previous screamed bloody murder about "bondage and discipline languages", who stopped screaming when they realized that the compiler was finding BUGS that would have eaten them alive during testing.)
Jul
15
comment Is there still any value in learning assembly languages today?
You would be AMAZED how much IBM 360 business applications programming was done in assembly language, because of hard performance requirements that just could not be met with the high-level languages and compilers of the day (or because the compiler was considered to be too expensive, or because the code was ported from an earlier system...)
Jul
15
comment What diagram would be the best to describe the situation
Actually, the UML activity diagram is a flowchart with funny-shaped boxes.
Jul
14
answered Parsing mathematical expressions with two values that have parentheses and minus signs