5 ms·
My programming lecturer used to say "programming is the process of breaking a problem down so a high speed idiot can understand it, if you don't understand the
by noir_lord 11y ago
My programming lecturer used to say "programming is the process of breaking a problem down so a high speed idiot can understand it, if you don't understand the problem then you can't explain it".
He also said that a programmers most useful tool was a pencil and a 5mm square A4 pad.
After years of solving thorny problems by getting away from the screen and scribbling in a pad I can't say he was wrong.
- dozzie 11y agoHe was very wise on this matter. The best code I've written was thanks to first designing it on paper.
- noir_lord 11y agoHe was an insanely smart guy, Type 2 Unixbeard (the skinny one with the pony tail rather than Type 1, the portly one with the T-shirt of a bankrupt tech company). Back in the 80's he worked on the software that ran/runs digital switching for (iirc) BT, high scale, high reliability stuff in C.
- 13of40 11y agoI don't write on paper anymore, but I still write all my comments first, then fill in the code.
- eru 11y agoHaskell has a mode, where you everything is a comment by default, and lines of code have to be marked as such.
- throwaway999888 11y agoAlso known as literate programming.
- cheez 11y agoOne time, in university I did not have access to a computer for a couple of days and had to write code for a b-tree in C++. I designed and wrote the code fully on paper and when I got access to a computer, I typed it in and it worked! I think that was my peak.
- epalmer 11y ago>I think that was my peak. Have you tried to recreate that peak? I'm wondering if it worked so well why you might not have continued working in that mode?
- cheez 11y agoMy statement was a little tongue-in-cheek but that was the first time I felt the raw power of my mind. I still feel it now, but it doesn't have as much of an impact as it did then. It's probably what everyone feels when they are in the zone. So now, I will walk around doing nothing for 4 to 5 hours to let my brain work on a problem, then type it in and have it work in 10 minutes. I do this same thing with design, not just code. I've noticed that coding has become a lot easier as a result. I still get stuck when I'm dealing with other people's bugs though, especially with third party libraries. One I've noticed is that being in my head so much makes it more difficult to explain things to other people and I think this hurts me.
- orionblastar 11y agoYes I learned how to program on paper. It was when computer access was expensive. We learned how to write code on paper and then go over each line with a table for variable values as we run over the code. I learned BASIC on punch cards using an IBM Mainframe for the junior high school math computer club, and it got changed to the math contest club after they couldn't afford computer time anymore. In modern times there are IDEs to help people, but most of my best code I used to write on paper first. Visual Studio kind of ruined that as I wrote code in their IDE and painted forms for GUI access.
- chris11 11y agoDo you still do any programming on paper? I've noticed I've occasionally felt like I've relied too much on my tools like my IDE or Resharper. I've been thinking I should get in the habit of doing some programming using just a simply text editor or pencil/paper to prevent that.
- hguant 11y agoIf I'm doing something with threading I sketch out a framework for how things should work before writing any code. Just pseudo-code though.
- dozzie 11y agoIf you feel that, you certainly should. Going after simpler tools may give you somewhat different experience of programming, but for pen and paper, it's totally different. It has much friction along most of the axes (you can't cut'n'paste or easily rename your variables, and it's difficult to pre-plan the length of a block of instructions), but along some, the friction is non-existent (invalid and ad-hoc created syntax, not defined functions, ellipses for obvious arguments and statements). Combine all that and your mind starts thinking in a different way, focusing on different things than it would with a computer editor. I find it very beneficial in the early stage of planning a program (or a subsystem of program).
- orionblastar 11y agoI have a paper notebook that I used to design data tables and pseudo code for projects I wanted to work on. I misplaced it, I would work on it from time to time while riding on a Metrolink train. It is either in my house somewhere or someone stole it.
- mercer 11y agoThis might be a strange question, but what does 'scribbling on a pad' actually entail? Do you write the actual code, or is it usually more about drawing out the flow of program?
- 50CNT 11y agoFor me it's both. You're trying to visualize the problem, its parts and how they interact, and you may write down some code for specific sub problems because it just popped into your head and you don't want to context switch. There's a limited amount of things you can keep in your head at once, and the paper is somewhat of a navigational aid and rapid access memory. Paper also offers you a lot of flexibility in regards to laying out things fast and sketching things, which computers still don't have quite down yet. If I try to layout my thoughts in emacs or photoshop a lot of my processing power is taken up by the act of using the tool ("ugh, was it M-x rect or M-x rectangular-region"/"Let me get the pen tool, and the rectangle tool, and where did the tool tray go?"). Scribbling on a pad doesn't just apply to coding though, it's a useful technique for a lot of areas that have thorny problems that exceed your local memory capacity. Just my take on the technique.
- mercer 11y agoThis is good encouragement for me to try using pen and paper again. The problem is that every time I do, I get frustrated by how slow it is for me, my hands get cramped, and I miss the backspace key. But perhaps I just need to keep at it for a bit, because I do see (and have experienced, back in college) the advantages.
- 50CNT 11y agoThe backspace key equivalent of pen and paper is crossing things out/erasing them. If there's a line of writing I don't like, I'll cross it out and start that piece over. If you want to get faster and better at sketching diagrams I'd recommend you practice some of the basic techniques that say concept artists use. Straight lines from the elbow with little wrist movement and a little practice, and you'll be drawing things in no time in no time. Unless I need an incredibly straight line, I usually forgo rulers at this point. If your handwriting has slowed down, or you're cramping, you might want to give that a little bit of practice as well. No need for the cleanest Suetterlin, but getting posture right and yourself up to speed might be worth the time investment. I've been playing around with the palmer method recently, it seems quite nice for this purpose. Then there's tools. You don't want to be writing with cheap ballpoint pens on rough paper. The lines don't come out properly, which will make you press harder, which leads to fatigue. My current favourite pens are the Uniball eye-fine which is my go to for writing, as its a very smooth disposable ink pen. I've got one of those in front of me with a Kum ergonomic grip. Fountain pens are also very nice, and an entry level Lamy, Pelikan or Pilot will serve you nicely, but they're more suited for linear writing as they may smudge. Pencils are nice for sketching, but you have to sharpen them, which is annoying. For regular use I use a Faber-Castell Grip 1345 0.5mm mechanical pencil, which is still affordable but doesn't have many of the issues that cheaper mechanical pencils suffer from (broken leads, leads going back in because of insufficient internal grip, etc.). The Faber-Castel leads are also very nice and sturdy and make decent lines even at low pressures. Paper isn't that variable, as long as you don't totally cheap out on it. I'm particular to .5cm grid paper, but there's circumstances when plain white is nicer to work on. It's a bit much of a list, but I think a lot about stationery. You don't need all of these, and if you find other tools that do the job for you, then by all means go for them, these are just my personal favourites. One pen and a block of paper is more than sufficient. But I do think coding and thinking through problems on paper is a valuable skill. One neat thing it allows you to do is to go to a different place than the one you type things at to go think deeply about problems, because it's a lot more portable than a laptop. If like me, you haven't quite figured out how pseudo-code works and still write straight up source code, it also gives you a reason to memorize reserved words which I find does make things quicker ("was it import or include?"). And finally, your IDE won't distract you by having the gumption to tell you that "hey, you aren't using this variable, you lugnut, lookie look, this import is BROKEN! Aint you got any IntelliSense in you?" when you really want to be thinking about more conceptual things and not tiny implementation details. Sometimes you do do your best work when you're away from where you do your regular work.
- jacquesm 11y agoI keep my notebooks for many years and occasionally have fun looking back at old ones and trying to understand what it was that I was struggling with at the time. Usually I can't so somehow these doodles were extremely helpful while trying to pin down some problem long enough to be able to solve it but they definitely don't serve their intended goal as long term documentation for me. I probably should simply discard them.
- visakanv 11y agoI'm a pens-and-notebooks power user, and I know exactly what you're talking about. The trick is, whenever you're writing anything, add notes for your future self to make sense of whatever you're doing. It's like adding comments to explain your code. It's a little extra effort and bookkeeping but it makes old content so much more valuable!
- jacquesm 11y agoThat's a good insight. Thank you!
- jwdunne 11y agoThat's interesting. I do the reverse. I have a trail of hundreds of mind maps and lists on paper, some of them probably recycled by now. I've always wondered if it would have been better to save them and review. I think I've lost a lot of work on some problems/ideas I wanted to explore that way. Probably forgotten a good number of problems I was interested in to start with. Mostly personal though - professionally, my desk piles up until I'm forced to review the usefulness of each piece of paper (still, the 'where's that sheet gone' dance is common).
- baddox 11y agoInterestingly, it seems based on my limited understanding of many AI and machine learning techniques that these techniques don't really follow the rule. If you train an artificial neural network to recognize certain photographs, you don't really understand what is going on. You know how the artificial neurons work, and how the training process works to apply weights to various connections between neurons, but you don't really know in precise terms what is going on any more than you do with a biological neural network. I don't know what the implications of this are, or even if my simplistic understanding is accurate, but it does seem interesting.
- _0ffh 11y agoWell, one implication is quite obvious. Using ML-techniques you are sometimes able to solve a problem even if you don't have a precise idea of how you would do it. I feel that's part of the point, really. [Edit: Elaboration] In ML, you effectively transform your problem from "What piece of code will solve my problem?" to "What piece of data-driven code might solve my problem, and how do I acquire the right set of data?". Also, some ML-algorithms are designed specifically to enable you to analyze their "reasoning" about the problem after they have been trained.