138 points · by avk · 16y ago · 90 comments
With the obligatory footnote: "Unless you get into multithreading - then all bets are off." ;-)
The computer will do exactly what you tell it to, but your brain is not capable of determining exactly what the computer will do (it'll process billions of instructions a second, if you tried to fully map out the operations of a computer in complete detail you wouldn't get even a fraction of a second done in your lifetime). Which is why we have to use abstractions, models, and various techniques to render that complexity manageable by human minds.
I wish there were a better/more formal way to quote things on HN as it can lead to confusion with attribution. Purely italic text doesn't quite cut it, but nor does the "source code" quoting feature.
2. If you think you have a reliable system for doing it, you're probably doing the computer's job
1. Graph search
2. Representing problems as graph search
- multi-agent systems
- knowledge representation/reasoning
- machine learning
- CSPs
"Learning" probably captures the bulk of it.So a lot of the interesting work (imo) is on non-graph knowledge representations, like answer-set programming, situation calculus, etc. They often ground out in some variety of graph search to do the inference, but that's just the solver algorithm, not where the research that interests me is at. It's like saying that graph search grounds out in x86 asm twiddling bits in a computer, so all AI is just bits in a computer, which is also true but misses the point.
Though it does remind me that there was a comment from someone in the 60s or 70s amounting to, "all AI boils down to heuristic search".
I usually find that making it fast makes it inelegant.
You still need to pick the right algorithms, but I've personally been really focusing on elegancy. Maintenance and Operation of code is the major costs of software, not writing new stuff -- so when you write new stuff, I believe that decreasing those other costs should be the first priority.
That said, I agree with you. Most of the time, the elegant solution is fast or can be made fast.
'git' is a good example of this.
I also find that a lot of times when programmers look at something elegant and say "that'll be slow", it's because they're wrongly estimating the relative speeds of things. A common example: they're counting function calls when they should be counting I/O operations that are many, many orders of magnitude slower.
1. You have to figure out what you need to build.
2. Engineer the solution in such a way that changes in the requirements result in relatively minor changes to the code.
A good ballpark, but not entirely true. At some point you'll end up with a smaller problem that cannot be broken up further. For the most part these may be solved problems, like `increment foo`, but at some point you might hit an unsolved atomic level problem that you either need to spend a lot of time working on, or forces you to find an alternative path.
2. Managing Expectations
2. You've overlooked or ignored things that need to be considered.
Pretty much sums up the source of all pain in day-to-day programming.
As for "incentives matter," what, because incentives incentivize?
1. You don't know what you're talking about.
2. You don't know it yet.
2. Accepting thing #1 will make you a better programmer
2. Write for the human
2. Empathy for users and other programmers