Ask HN: Learning to code, without a computer?
I have a friend who is incarcerated, and is dedicated to learning how to code, no matter how slow or arduous the process may be. He has no access to a computer, just books and writing utensils. While it may be very difficult, what are suggestions you have on how to give him the best chance for success?
Even if he's not learning a specific language, what are some background concepts he can learn in depth that will help him understand coding? I recommended he study algorithms as a starting point but I am not a dev and am not sure how to proceed without a computer.
I realize this is an unusual question, but I greatly appreciate any responses. It's sad that someone so badly wants to improve themselves and can't easily do so because of our archaic prison system. I want to help give him a chance to have a real profession once released. Thank you!
193 comments
[ 3.7 ms ] story [ 226 ms ] threadThis does not give any experience in debugging, which is not taught in books, AFAIK. I am not sure what to do about that...
CS theory probably makes a good starting point, as a lot of it doesn't require actual coding, but still lays a solid foundation for future work. I would recommend SICP (Structure and Interpretation of Computer Programs, by Abelson and Sussman) as a good starting point. It uses Scheme, which isn't exactly a language he's likely to end up working in, but it will teach him a whole lot about thinking like a programmer.
https://www.amazon.com/How-Design-Programs-Introduction-Prog...
He may write programs on paper, and send them to you to type them in, compile them, and print out a listing with the errors. You then send back the listing, and he will correct his program and repeat.
He'll become a great programmer, since he will have to be extra careful to avoid losing one week on some typo.
Now, it's been a few years since gcc has been able to produce a real listing of the compiled source. You would have to write some script to combine the error output with the source file to produce a classic listing. Similarly for other common modern programming language implementations.
On the other hand, without direct access to a computer, he would not attempt to write any interactive or GUI application, only batch programs, unless the interaction is performed only by an external tester for him.
Another idea: some progress has been made on optical character recognition, so if he can write well enough, it may be possible that you may be able to scan his written programs, and convert them to source file easily, without having to transcribe them. So the process could be smooth enough.
If writing ustensils include typewriter, then even better for the OCR!
Reminds me of this Reply All podcast episode https://gimletmedia.com/episode/64-on-the-inside/
"For years, Paul Modrowski has been writing a blog from inside a maximum security prison. Only thing is, he was arrested when he was 18 and has never seen the internet."
Can you share with readers the version number for the last gcc that can do this satisfactorily?
The guy could 'run' his hand written programs on his own.
Unless, by chance, you were suggesting he set up some kind of turing machine where running is a different matter than reading your program over in your head?
I'd pay good money to know what the prison superintendent thinks of this cryptic communication.
(I kid, of course.)
We learned to code by typing out programs on the selectrics...
Comments like this reminds me of how much of a difference is to live in a 3rd-world country compared to a 1st-world country. I am still on my twenties and I can still relate to what the parent comment says, I learned the basis of my programming skills reading books around ~8 years ago because during that time having a personal computer in my home country was a luxury. Very often I joke with my friends that most of the innovative things that we find in the market are already +3 years old. I still remember the popularity of the BlackBerry when it was already obsolete in the US because of the iPhone.
One thing I did during that time to learn some algorithms was to buy a deck of cards — which I suppose is allowed in jail — which allows you to understand sorting algorithms and some of the basic data structures like queues and stacks. Writing things on paper might also help to visualize and memorize some concepts (I know, memorizing is not the solution, but what else can you do when you cannot run your code in a computer).
I hope it helps, and good luck to @givinguflac 's friend.
I was going to ask if he has access to a smartphone to take and send photos of paper?
Set up a server for it. Hell turn it into a business.
Basically it's a listing that intermixes the original C code with the generated assembly.
It worked fine on my Ubuntu 16.04 system, running GCC 5.4.0 so I don't understand what was better before.
I would concentrate on the things that don't require a computer- algorithms and mathematical type stuff (the stuff I am not particularly good at these days because I am usually setting up servers, using a database and high level frameworks).
With music, we are taught to read before we write.
With programming, we start out writing.
This seems like a great chance for your friend to try out the music learning approach. Send them books of excellently written programs, and allow them to read before they write.
[As a side note: What is their goal? To program to become a software engineer? To program to build web applications for fun? To program to learn how to build products to produce a profit for themselves? The goals will inform the process.]
What we find easy is to read programs we wrote. Recently.
(I'm trying to help change this: http://akkartik.name/about)
When they're out the hard working ones will have programming skills which will help with the job hunt.
"Why am I paying to have rapists, killers and thieves jerk around on the internet all day," they'll say, while voting out the party responsible and voting in the party promising to take the computers away and make the inmates break rocks in the sun until they drop.
Those are topics that one could make progress on with only a pencil, paper, and the occasional phone call to a mentor.
I cannot imagine submitting punch cards and reading JavaScript stack traces by mail.
As an EE student, there are plenty of engineers who know nothing about those topics (except maybe linear algebra) that have successfully completed the image processing/computer vision course.
"Featuring a strong emphasis on the fundamentals underlying contemporary logic design using hardware description languages, synthesis, and verification,"
You mean to tell me that set theory is too abstract, but full-adders and VHDL are right up his alley.
The problem is that most mathematicians don't have more than a surface level working knowledge of set theory, because they don't think it's useful. It's even less useful for computer scientists (who use type theory any way).
With the exception of set theory, I've taken the classes you've mentioned, and while they've been very useful for electrical engineering, I don't believe they're useful for software engineering.
SICP, dearth of practical experience... MIT? Any case, you live in a daycare. Remember we're talking about someone incarcerated.
https://www.amazon.com/Programming-Language-Brian-W-Kernigha...
I'd also learn SICP: https://www.amazon.com/Structure-Interpretation-Computer-Pro...
and algorithms from either CLRS https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press... or Skiena Algorithm Design https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena...
Once that is worked through, Godel, Escher, Bach would be an especially entertaining and enlightening read.
So what books do I have?
Books on usability and web accessibility are good reads, however no obvious title springs to mind ('Don't Make Me Think!' would last your friend all of a morning).
One thing though, chess. Chess is played in prisons and some prisoners get rather good at it. Maybe encourage your friend to form a chess league if there isn't one already. Perhaps get him a really good book on chess that can be used by this chess league to be.
https://en.wikipedia.org/wiki/CARDboard_Illustrative_Aid_to_...
the HEAD First book series, they have fill in the blanks programming exercises.
Also the following books, which I've copied and pasted from somewhere, to learn theory:
Mano, M. Digital Design, 3rd ed. Prentice Hall, 2002
Mano, M and Kime, C Logic and Computer Design Fundamentals, 2nd ed Prentice Hall, 2001
Gajski, D Principles of Digital Design Prentice Hall, 1997
Tanenbaum, A Structured Computer Organization, 5th ed Prentice Hall, 2006
Patt, Y and Patel, S Introduction to Computing Systems: From Bits and Gates to C and Beyond, 2nd ed. McGraw Hill, 2004
Null, L and Lobur, J The Essentials of Computer Organization and Architecture, 2nd ed Jones and Bartlett Publishers, 2006
SICP: "We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells."
Code: "You're 10 years old. Your best friend lives across the street. In fact, the windows of your bedrooms face each other. Every night, after your parents have declared bedtime at the usual indecently early hour, you still need to exchange thoughts, observations, secrets, gossip, jokes, and dreams. No one can blame you. After all, the impulse to communicate is one of the most human of traits."
Also bear in mind that without access to a computer or external tutelage, it's going to be very difficult for your friend to know whether or not his code is working properly. Stratoscope's suggestion of hand execution (https://news.ycombinator.com/item?id=12668865) is a good suggestion to help combat this issue. However, this means most likely that your friend will need to start with a language that's simple in structure; this disqualifies most modern languages. BASIC, Pascal, C or other extremely simple languages will be most amenable to this type of hand execution.
It's probably safe say that it's more concise than others that I have read. A sentence in SICP could become a paragraph in a lesser book.
Frankly, I do not understand the people who are attempting to push CS textbooks on this person. The original question does not contain the words "computer science" anywhere within it.
[1] http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html [2] https://docs.racket-lang.org/racket-cheat/index.html
We used to frequently emulate a machine by hand on paper I think it was 16-bit but it might have been even smaller (not touched it since my first year of undergrad) and you could/can write a lot of cool programs for it.
We used to frequently emulate a machine by hand on paper I think it was 16-bit but it might have been even smaller (not touched it since my first year of undergrad) and you could/can write a lot of cool programs for it.
Apart from that... reading books and solving programming puzzles might be a good way. Something that has a feedback loop, which you won't have in the normal way without a computer at hand.
I must take my hat off for this kind of determination! I hope it provides your friend with a way out and they have a better life ahead of them.
Is he in state or federal prison? Are there no classes available that could give him access to a computer?
https://www.ohio.edu/ecampus/print/correctional/
or
https://www.adams.edu/extended_studies/undergrad/prisoncolle...
Would help if you shared the end goal. Get hired anywhere? Get hired by Top 4 Tech Company or Hot Startup of the Year? Start a business? Don't get bored? How long is he going to be incarcerated?
I would greatly appreciate if you shared your experience.
And it's just a book, and all exercises in it can (and should) be done with no computer.
Once he works through this, send him a copy of SICP: https://mitpress.mit.edu/sicp/ Covers some of the same material at a much higher level, and more.
Gary William Flake: Computational Beauty of Nature
Douglas Hofstadter: Godel Escher Bach
They won't make you a programmer ready for a job at Facebook; but they will entertain the part of your head that makes you a good programmer.
The two books are also very well written and quite entertaining which give you the motivation you miss if you cannot try things out on your own.
Other than that: Study math at any level.
While I was stuck in school and did not have access to a computer, I wanted to challenge myself during classes. The most interesting distraction by far was to play around with the programming functions of my TI-82 calculator that was required for math classes. Even with almost no idea about programming I could soon do interesting things with it, because it is programmed using a version of BASIC. In the end I even created a clone of snake. It worked, but moving one block ahead would take 2 seconds.
I also did programming with my TI calculators back in school.
In this context, the 83 is an awful, awful choice, because TI-83 programs only allow for variable names to be one character long. I was lucky, when someone asked me to copy my TI-85 blackjack program into their TI-83, that I had used less than 28 variables.
True, but very sad. I am given to understand, from an HN thread months ago, that the state of the art in school graphing calculators now is the HP Prime. But that never even gets mentioned in recommendations, because no one's ever heard of it. (And there's very little incentive to learn what to recommend, because the only value of a graphing calculator is that it's permitted on standardized tests -- the HP Prime is $165; the HP Prime software for your Android phone is $10.)
> I was envious of my friend's 89, but my parents wouldn't pay the higher cost.
Also sad. I read the manual for my TI-85 cover to cover; it taught me about polar coordinates and euclidean vectors before my school covered them. For a child interested in math, these calculators can be wonderful.
Nice! I ended up creating a Minesweeper clone. I remember the program being really long, and really annoying to write without having access to actual recursion.
My first thoughts:
- iterate more quickly by experimenting with non-computer users who aren't in prison, as letters/email to a prisoner will have a slower feedback loop
- learn what people consider to be more fun, and and try to structure lessons within that
- see if there are some existing resources that are close to, but not exactly like, programming without a computer
- set up an open source curriculum on GitHub, so people besides yourself can contribute
It might be a good place to start, at the very least. But it will only appeal to a certain sort of person.
One of the key things to also understand here is - what is missed out in this type of training. Tools. Tools. Tools.
As developers we have come far away from limited IDEs. We rely on so many tools that knowing-they-exist or sometimes mastering them is difference between good-or-bad devs. I would recommend to read printed material about IDEs, screen shots of tools.
Couple of other things I have found really helpful: * I had underestimated Medium as a platform to rely for tech news till lately. There is so much of latest developer/platform news and articles. Print outs of these definitely help. * Stackshare posts (http://stackshare.io/featured-posts) on what stacks/tools companies use (and how) are eye opening to say the least. Print outs of this.
Suggestions for absolutely no computers:
* CLRS, the classic. (I just skimmed the intro, though, and if he has no background in uni-level maths, it might be a little tough to digest.)
* (maybe) the Head First series (as someone else suggested). I'm wary of suggesting it not just because I have no experience with the books (I only even mention it because I know they're ubiquitous), but also because bad habits are formed early, and this could do that.
* Patterson and Hennessy - Computer Organization and Design (5d.)
* Sebesta - Concepts of Programming Languages (11d.) (but only after finishing some of CLRS, and even then I don't know how appropriate this is)
=====
What kind of experience did he have with computers before he went in?
Depending, you may be able to make recommendations about stuff relevant to what he's used.
=====
Can you get him something like a TI-84? Because even that will at least allow him to go in and write TI-BASIC.