10 ms·
The Two Things about Computer Programming
- meese_ 16y ago"There are only two hard problems in Computer Science: cache invalidation and naming things." - Phil Karlton
- michael_dorfman 16y ago"There are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors."
- deleted 16y ago[deleted]
- mathgladiator 16y agoComputer Science = 1. How to represent data 2. How to transform representations
- techbio 16y ago1. Defining problem space. 2. Input/Output.
- ColinDabritz 16y ago1. Solving the right problem 2. Managing Expectations
- KeithMajhor 16y agoThat's beautiful. However, programming is only one of many fields for which you could apply those "two things".
- ColinDabritz 16y agoInteresting. So perhaps we're talking about the 'two things' that are specific to software development. Maybe it's worth considering the rest of the different 'two things' that apply more generally as well?
- dkokelley 16y agoI think this applies to all client-based work, programming included.
- ericflo 16y ago> Make it work, then make it elegant, then make it fast. I usually find that making it fast makes it inelegant.
- pquerna 16y agoMaking it 'raw fast' is what compilers/JITs are for. 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.
- j_baker 16y agoI think you mean "elegance". ;-) That said, I agree with you. Most of the time, the elegant solution is fast or can be made fast.
- davvid 16y agoI agree completely. A common mistake is thinking that performance can be tacked-on later. Thinking about performance up-front can inform elegant designs. 'git' is a good example of this.
- InclinedPlane 16y agoTargeted performance improvements tend to make specific operations more efficient. Elegant architectures tend to completely eliminate huge swaths of duplicate and unnecessary operations, and so typically have the opportunity for much greater performance improvements.
- glhaynes 16y agoI don't find that at all — I find that keeping it elegant keeps it adaptable, applicable in a broad set of circumstances, and understandable. And that these things keep a program from getting slower over time (both pre- and post-deployment) as requirements change. 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.
- vb6 16y ago1: You love it, 2: You hate it.
- petercooper 16y agoThe computer will always do exactly what you tell it to. With the obligatory footnote: "Unless you get into multithreading - then all bets are off." ;-)
- j_baker 16y agoEven if you multithread, it will still do exactly what you tell it to. It's just that it becomes even easier to tell it the wrong thing. ;-)
- KeithMajhor 16y agoMultithreading sacrifices determinism. So, regardless of what you tell it you can't make any claims of exactness about what it's doing.
- dhume 16y agoThe programmer is still allowed to specify operations to perform as well as restrictions on the order in which the operations are performed. Not fully specifying what to do just gives the computer more options to pick from -- it will still pick one of those options.
- AgentConundrum 16y agoit will still pick one of those options which is the part that gets rid of the "does what you tell it" bit, since now it's doing what it thinks it should, which might not be very consistent or easily determinable because minor variations during a race can produce wildly differing results.
- dhume 16y agoIf I tell someone, "bring me a sandwich or a bowl of chili," and the person brings me a bowl of chili, that person has done exactly what I told them to do.
- rarestblog 16y agoI'd change second thing about Computer Programming to: "Something ALWAYS goes wrong and your job is to fix it"
- extension 16y ago1. Nobody really knows how to do it 2. If you think you have a reliable system for doing it, you're probably doing the computer's job
- Jupe 16y ago1. Nearly every decision makes the simple stuff more complicated 2. Accepting thing #1 will make you a better programmer
- hasenj 16y ago1. Abstract thinking 2. Empathy for users and other programmers
- edw519 16y ago1 and 0
- hxa7241 16y agoYou left out the set-up line: "Fundamentally, there are 10 things about software:"
- limist 16y agoClosely related to the first Thing of problem reductionism: "All problems in computer science can be solved by another level of indirection... Except for the problem of too many layers of indirection." — David Wheeler
- philwelch 16y agoThis is fortuitous, because just this week I started realizing there are Two Things about AI: 1. Graph search 2. Representing problems as graph search
- klochner 16y agoFor (2) I'd try to work in: - multi-agent systems - knowledge representation/reasoning - machine learning - CSPs "Learning" probably captures the bulk of it.
- philwelch 16y agoKnowledge representation--depends on which kind. The kind that involves logic and resolution turns out to be just another problem that you have to represent as graph search.
- _delirium 16y agoOn the low, algorithmic level that's often true, but a lot of the difficulty imo is at higher levels of the stack. We're very good at writing SAT-solvers, for example, but directly writing problems as SAT is not a particularly good knowledge representation, especially if you want to build systems that are flexible and can interact with humans. 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".
- chrismealy 16y agoThe two things economists know are hilarious -- square "no free lunch" with "gains from trade." Do the gains from trade have a price? Who pays that? As for "incentives matter," what, because incentives incentivize?
- duncanj 16y agoI feel like the two things economists need to know are: 1. You don't know what you're talking about. 2. You don't know it yet.
- biotech 16y agoThe two things about software engineering: 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.
- mirkules 16y agoThis reminds me of the tree swing: http://blog.thingsdesigner.com/uploads/id/tree_swing_development_requirements.jpg http://blog.thingsdesigner.com/uploads/id/tree_swing_develop...
- hxa7241 16y ago1. Write for the computer 2. Write for the human
- bluesmoon 16y agoEvery problem can be solved by breaking it up into a series of smaller problems. 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.
- leif 16y agoWhen you hit a problem like that, it's time to start going in the other direction. All problems in computer science can be solved by another level of indirection.
- eru 16y agoPlease solve the halting problem with indirection. Thanks!
- Dylan16807 16y agoSure! Here's your wrapper that abstracts the concept of processes and never says 'done'.
- eru 16y agoSome computations (and most computations of practical importance) do halt eventually.
- Dylan16807 16y agoDoesn't matter, it's indirected away. All you know is that you were done asking it for data.
- eru 16y agoI don't get it.
- fotoblur 16y agoThis reminds me of: "All Our Programming Languages Boil Down to Sequence, Selection and Iteration" http://bit.ly/9lwT8e http://bit.ly/9lwT8e
- Kilimanjaro 16y agoSimplicity and beauty are my two coding principles.
- gfodor 16y ago1. You're assuming things that you've not verified. 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.
- signa11 16y agohmm, i was thinking 'All problems can be solved by another level of indirection' should be somewhere pretty high up...
- flgb 16y agoThe two things in computer programming are automation and abstraction. That is all.
- VMG 16y agoInteresting idea - but I have never worked out what the two ideas of biology are.