Reputation
9,908
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 22 43
Newest
 Good Answer
Impact
~521k people reached

Sep
5
comment Has “Not everyone can be a programmer” been studied?
@Jimmy: I tried to make it interesting by getting them going on personal projects about games, science, finance, music, whatever appealed to them. Programming is much more interesting when it's a means to an end.
Sep
3
comment Does it still make sense to think about effective code on micro scale in C++?
@Martin: Thanks for making my favorite point. People figure if the profiler can't find it, nobody can, which is silly, at best.
Aug
22
comment Is there any better approach to shortest path finding within a (vehicular) traffic network?
I'm not clear what N and V are. Is V the number of vertices (intersections) and N the number of arcs between vertices? Also, what is E?
Aug
16
comment How will quantum computing change programming?
@Philip: Suppose you have a 1024-entry table, so it takes 10 bits to index it. You have a 10-(qu)bit register, and it has 1024 possible states. OK, so you create a universe in which the register is 0, another in which it is 1, up to 1024 parallel universes. Then the quantum "instructions" operate on all of these in parallel. Each universe has an "amplitude vector", whose magnitude is its probability, but it also has a direction, and those are being manipulated. Since the collection of 1024 vectors has a non-zero average vector, the rotation makes one bigger, the rest smaller.
Aug
16
comment How will quantum computing change programming?
@Philip: I know the math is pretty off-putting, but the key idea is the rotation about the mean, which has the effect of transferring probability to the answer state. Then you run back to the beginning and run forward and do it again, a certain number of times. Then if you do the observation, you've maximized the probability of seeing the answer state.
Aug
10
comment If your algorithm is correct, does it matter how long it took you to write it?
@Jaydee: I think of performance in terms of percentages, as opposed to a teeny bit multiplied over jillions of runs. I've managed to ruffle feathers with this viewpoint, but often programs contain larger speedup opportunities than you might think, but you do have to be smart about how you look for them.
Aug
10
comment If your algorithm is correct, does it matter how long it took you to write it?
IMHO it's more important to be right than to be quick. Often I don't feel like I really believe in an algorithm/program/language design until the 3rd or 4th version. At the same time, I'm often told that I work fast, but I don't look at it that way. As I look around, people just tend to make things way too complicated.
Jul
5
comment Designing an email system to guarantee delivery
Just thinking out loud: Why not design an email system where the sender pays the recipient a certain amount for each message? The recipient would choose the amount, and it could be different for different senders. That would put a screeching halt to spam, and the worthwhile messages might actually get through.
Jun
30
comment if you were asked to answer to the question “ what is the difference between the English language and a programming language” how you will respond?
@DeadMG: Try reading Lacuna, The Death of Ivan Illych, Heart of Darkness, Mrs. Dalloway, or A Thousand Acres and show me a comparable program. Software does something for you. Literature does something to you.
Jun
12
comment What is the meaning of the sentence “we wanted it to be compiled so it’s not burning CPU doing the wrong stuff.”
@JoachimSauer: You're right of course. It's still hard to make an interpreter run with less than a factor of 10 speed penalty compared to compiled code. If the language is one that really spends all its time in subordinate compiled functions that have to be called anyway, like math libraries or I/O, the cost of interpreting is not a problem.
Jun
2
comment Why do some programmers think there is a contrast between theory and practice?
@LieRyan: Engineers have draftsmen (er.. persons) (or CAD tools) to make their detail drawings. (I did that too.) On the issue of ingenuity, it's a gripe of mine, because I've stumbled on a couple of techniques with big payoff - random pausing and differential execution - and the counter-argument I hear most often boils down to "that's not what people were taught" (i.e. not readable). Heaven forbid they should have to be open to something new to get higher productivity.
Jun
1
comment Why do some programmers think there is a contrast between theory and practice?
In my exposure to civil engineering (way back when) there were fields of study on structures, soils, waterways, highways & railways, etc. (You wouldn't believe the math, physics, & fancy programming involved.) Then also project management, costing, etc.
May
29
comment Why is quicksort better than other sorting algorithms in practice?
+ Right. Teachers need to be more aware (and I was a teacher) of the fact that constant factors can vary by orders of magnitude. So the skill of performance tuning really matters, regardless of big-O. The problem is, they keep teaching gprof, only because they have to get past that bullet point in the curriculum, which is 180 degrees the wrong approach.
May
24
comment Software Optimization vs. Hardware Optimization - what has the bigger impact?
@dwelch: 9600 baud was considered state-of-the-art fast not that long ago.
May
20
comment How to deal with over-complication?
+1 for the St-Exupéry quote.
May
8
comment Why isn't the line count in Visual Studio zero-based?
@svick: I know, but programmers can be silly. 1) Know how the "mod" function in math should give you a number from 0 to N-1? Well, "%" says -1%3 is -1. This also affects the way "/" works. Why? Principle of minimum surprise. 2) On performance most (not all) programmers have a blind spot - they think you have to measure to find what to fix. Even if you show them why that's not so, they treat you like you're crazy.
Apr
27
comment Merge sort versus quick sort performance
@Neil: Is that right, that mergesort prefers a mostly sorted list? I thought mergesort was basically the same no matter what.
Apr
26
comment Merge sort versus quick sort performance
As Robert said, quicksort is only quadratic in the worst case, and that's easily fixed. In general, the way to compare algorithms is by counting some basic operation, like comparison. Semantically equivalent programs can vary dramatically in their constant factors, with aggressive tuning needed to make them as fast as possible.
Apr
15
comment Performance analysis of C++ programs
@AT: Industry-standard metrics? What are those?
Apr
14
comment Performance analysis of C++ programs
@AT: Then what I would do is count basic operations, not measure time, because the same algorithm can easily differ between different implementations by orders of magnitude, as demonstrated here.