News for hackers. Stuff that matters.
Re:Why programming is a good medium for expressing poorly un... by noir_lord on Saturday January 23, 2016 @07:40PM (#10960884)
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.

Re:Why programming is a good medium for expressing poorly un... by orionblastar on Saturday January 23, 2016 @10:28PM (#10961334)
Yes 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.

Re:Why programming is a good medium for expressing poorly un... by chris11 on Sunday January 24, 2016 @12:11AM (#10961552)
Do 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.
Re:Why programming is a good medium for expressing poorly un... by dozzie on Sunday January 24, 2016 @08:25AM (#10962425)
If 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).

Re:Why programming is a good medium for expressing poorly un... by orionblastar on Sunday January 24, 2016 @07:01PM (#10964690)
I 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.

Re:Why programming is a good medium for expressing poorly un... by hguant on Sunday January 24, 2016 @12:41AM (#10961621)
If I'm doing something with threading I sketch out a framework for how things should work before writing any code. Just pseudo-code though.
Re:Why programming is a good medium for expressing poorly un... by dozzie on Saturday January 23, 2016 @07:45PM (#10960899)
He was very wise on this matter. The best code I've written was thanks to first designing it on paper.
Re:Why programming is a good medium for expressing poorly un... by noir_lord on Saturday January 23, 2016 @08:24PM (#10961027)
He 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.

Re:Why programming is a good medium for expressing poorly un... by meowface on Sunday January 24, 2016 @12:07AM (#10961548)
I had only one Unixbeard professor, and he was the best one I had in my program. He was also a Type 2.
Re:Why programming is a good medium for expressing poorly un... by collyw on Sunday January 24, 2016 @09:46AM (#10962623)
I wish I had had a Unixbeard prof.
Re:Why programming is a good medium for expressing poorly un... by cheez on Saturday January 23, 2016 @09:14PM (#10961155)
One 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.

Re:Why programming is a good medium for expressing poorly un... by epalmer on Sunday January 24, 2016 @06:35AM (#10962236)
>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?

Re:Why programming is a good medium for expressing poorly un... by cheez on Sunday January 24, 2016 @12:40PM (#10963192)
My 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.

Re:Why programming is a good medium for expressing poorly un... by 13of40 on Saturday January 23, 2016 @08:42PM (#10961080)
I don't write on paper anymore, but I still write all my comments first, then fill in the code.
Re:Why programming is a good medium for expressing poorly un... by eru on Sunday January 24, 2016 @05:49AM (#10962160)
Haskell has a mode, where you everything is a comment by default, and lines of code have to be marked as such.
Re:Why programming is a good medium for expressing poorly un... by jacquesm on Sunday January 24, 2016 @07:34AM (#10962335)
I 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.
Re:Why programming is a good medium for expressing poorly un... by visakanv on Sunday January 24, 2016 @07:45AM (#10962349)
I'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!

Re:Why programming is a good medium for expressing poorly un... by jacquesm on Sunday January 24, 2016 @08:53AM (#10962484)
That's a good insight. Thank you!
Re:Why programming is a good medium for expressing poorly un... by jwdunne on Sunday January 24, 2016 @08:42AM (#10962463)
That'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).
Re:Why programming is a good medium for expressing poorly un... by baddox on Sunday January 24, 2016 @08:29PM (#10965040)
Interestingly, 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.

Re:Why programming is a good medium for expressing poorly un... by _0ffh on Monday January 25, 2016 @08:19AM (#10966979)
Well, 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.

Re:Why programming is a good medium for expressing poorly un... by mercer on Sunday January 24, 2016 @02:50AM (#10961869)
This 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?
Re:Why programming is a good medium for expressing poorly un... by 50CNT on Sunday January 24, 2016 @04:32AM (#10962055)
For 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.

Re:Why programming is a good medium for expressing poorly un... by mercer on Sunday January 24, 2016 @05:31AM (#10962141)
This 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.
Re:Why programming is a good medium for expressing poorly un... by 50CNT on Sunday January 24, 2016 @07:12AM (#10962302)
The 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.

Re:Why programming is a good medium for expressing poorly un... by jwdunne on Sunday January 24, 2016 @08:32AM (#10962436)
Great advice here. Regarding beat drawing of diagrams with lines drawn from the elbow, there is a great set of online lessons that teach this through exercises. I totally recommend it:

http://drawabox.com/lesson/1

I have improved my drawing ability significantly by following these lessons.

Re:Why programming is a good medium for expressing poorly un... by antod on Sunday January 24, 2016 @08:52PM (#10965125)
> 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.

Drawing the problem is also useful because it focusses different parts of your brain on the problem. If the problem was easy to solve with just the more linear textual parts, you probably could just have sat down and coded it.

But if that's not enough, engaging the visual and spacial parts can help you understand the solution without being able to verbalise it (ie code it) yet.

Re:Why programming is a good medium for expressing poorly un... by phyllostachys on Monday January 25, 2016 @02:10PM (#10969174)
The Palmer method, that is what I learned back in the mid-nineties in elementary school. I didn't know it had a proper name other than 'cursive writing'. Neat!

Edit: Err wait, maybe not. It looks the same but so does the Zaner-Bloser form. Looking at some more methods, apparently I don't understand how it all works.

Re:Why programming is a good medium for expressing poorly un... by visakanv on Sunday January 24, 2016 @07:47AM (#10962356)
Great advice, great comment. I appreciate this, thanks for sharing.
Re:Why programming is a good medium for expressing poorly un... by collyw on Sunday January 24, 2016 @09:59AM (#10962658)
Drawing representations of data structures and algorithms for me. Imagine drawing a linked list. Probably a box with a pointer to another box. Code looks nothing like that, but when you have the idea on paper its a lot easier (for me) to work out what the code should be.