Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, August 20, 2009

Programming - Basic

I earlier said that computers are the defining element of our society. As such, it is a basic requirement to know how to program - if you want to claim to be educated. Without this essential idea you simply are missing out on one of the biggest developments in history and the defining element of "us".

But I did not give any reference for those interested in trying to learn this essential skill.

Here is a basic book (no pun intended), and here is a online basic interpreter to try the examples in the book [-1].

I recommend the book as it really is an introduction [0], and it is written by a famous coder Chris Crawford (so it has contextual interest). As far as I can tell this is the best basic introduction to programming. Your kids can and should read this. You can and should read this. If you cried your way through your science requirements in high school/university, cursing the gods for their cruel ways, you can and should read this. The book is (1) free, (2) short, (3) opinionated [1]. It gets the basic ideas down.

Looking for a general introduction shows there really is not a good option out there for people - could it really be that an old text thrown up on the internet, and used with a free online interpreter, is the best option out there? This seems to be a glaring hole in the literature. Back in the day you could fire up your Apple ][ and run the ubiquitous BASIC before playing a rousing game of Oregon Trail. There is lots of stuff out there, but nothing (modern) that is dirt simple and limited and just there that gets across the basic points [2].

Skimming through this book, You should learn to program by Chris Crawford, was interesting and I sat down and read it more carefully after the initial skim: it is enjoyable (!!), and is surprisingly close to some of my thoughts [3]. The book appears to best fill the niche of actually teaching programming to true beginners [4]. You too should learn to program, and Chris will show you how - and he includes an appendix on how computers work, as well as sociological commentary on the programmer culture.

"
Programming is like writing, woodworking, or photography. Anybody can do it. Doing it well, doing it like an expert – that takes a lot of work, a lot of experience, and a lot of talent. But anybody who can write a comprehensible paragraph can write a workable program. All it takes is a computer and some time." - Chris Crawford, Chapter 1

If you have ever taken a picture, wrote something, or made a simple wood project you know the pleasures that underlie these creations - we are built to act and create - and programming is yet one more form that you should explore to get some joy, learn about a key aspect of our society, and maybe find a new hobby or career [5].

Notes:
[-1] The interpreter linked above doesn't use line numbers, so some changes to the ancient "goto" examples in the book would be needed. This aspect of computers - evolution, versions, and changing infrastructure making things difficult is one of the characteristics of computing. Dealing with hacks is also a key skill - remember the "Y2K" problem? Get used to it, this is a painful yet important idea and learning to confront this is one of the "take home skills" you will get from programming - and these problems exist in all aspects of human tools and society. But to prevent complete initial frustration from being a barrier to entry use this one, I have not yet gone through the entire book with the interpreter but a random selection indicates things generally work (with one caveat: you must include line numbers to inform the interpreter).
[0]
Computer books are "sold by the pound" and are often huge poorly written books. Learning to program can improve your communication, but it will not automagically do this - as a look at most computer books attest to: you have to want it to and work hard at it, but programming does offer a route to better thinking and communication.
[1] Thus interesting. And the author has informed and earned opinions.
[2] There is "SmallBasic" from MS that looks okay, though only for PC's right now - why not on the web? Google has a powerful system, which has a great book for people ready for the next step of working with code that actually does stuff, but I don't see a dead simple system there either. Back in "the day" the Apple ][ was in every class, now a browser is everywhere. What is needed is someone like MS or Google making SmallBasic online - a big player backing a simple tool in order to make it ubiquitous. If you are a Google employee make it so with your 20% time!
[3] Overlap in opinion and ideas is likely a key factor in us deciding on likely quality of a text, and thus worth investing time on. Of course if the overlap is too large you just wasted your time, as you likely don't learn much! If the overlap is too small you likely will discount the text, or you may not be ready for the text. You want some sweet spot of agreeing with some points, and being mystified by some on a first scanning read. People who just read stuff that reiterates and defends their beliefs are called fundamentalists.
[4] If you think about it the vast amount of material in a first year CS class is huge, and one gets a split of the class into (a) those who have been previously exposed to the basics and find the class easy to a bit challenging, and (b) those who are crushed by the course as they have so many new things to learn all while competing against people well ahead of them. People in group (b) should likely read this book as a pre-course exercise to give them context and the basic ideas.
[5] Career? Likely not, but maybe... I am not a carpenter despite loving the one and only project I ever did. But I still have fond memories of my little creation. Even if your dip into programming is just reading Chris' book and playing with an online interpreter while do you do, well you will gain from it. Life is experiential.

Tuesday, August 18, 2009

Computers

What is our greatest achievement as a society? I don't mean our ancient roots that focus on democracy and individuals and limiting manipulative power while increasing personal (positive) power [0], no I mean us as in lately and what defines the biggest thing going right now.

Computers.

Computers have changed things, dramatically. Our society has fundamentally changed due to this, and will continue for some time [1].

The ancient Romans built their greatest masterpieces of architecture, their amphitheaters, for wild beasts to fight in.

- Voltaire

And we have built our greatest masterpiece - the internet - for porn, urban legends, and stupidity. But Voltaire is only partially correct. Sure, battles and fighting and other low brow stuff went on - but art and play and oratory also did. We can find lots of junk on the internet, lots of time wasters, lots of negative material - but like the Roman amphitheaters the structure itself is beautiful, and like all technologies use neutral [2]. I am amazed at the internet. There is so much constructive, and positive, and mind expanding, and interesting, and beautiful on the internet. And that is just one aspect of computers - the aspect that connects us to each other and our works.

Programming computers changes how you think - at its best it clarifies your thinking, changes your thinking, improves your communication, increases your ability (via tools you build), teaches you to check context more. Basically programming puts thinking into notation and makes it a tool, a tool to be used, perfected, analyzed, considered, honed. Writing improves your thinking and communicating, and so does programming [3] - perhaps because these practices are so closely linked to how we think [4] and as are both well suited to deliberate practice [5].

I had once thought that the bulk of the "and then what" of computers was over, we got cheap desktops and wired them up to chat: end of story, sure with some interesting epilogue but story arc climaxed. I no longer believe that. Richard Hamming would spend his Fridays thinking about how to use computers to change things in his work, and how computers are changing things in general [6]. We would all do well to do this. I now believe that computer science has taken the role that physics once held - the king of hard sciences. I say this as computer science is fundamental, growing, and deep. Godel's work and much else fits in to computer science, as does much of physics. People vote with their feet, and just like all [7] the smart people stopped going into philosophy a long, long time ago [8] I believe all the smart people are no longer going into physics. Yeah, there are smart people in physics but the smartest and most interesting go elsewhere. Where? This is an empirical question, but the deepest thinkers seem to fit into the category of computer science writ large [9].

One of the things that make humans so powerful is our ability to simulate in our brains (the future, possibilities, stories, ...). Computers are a tool we built that allows us to simulate outside our brains, and thus both study the simulation process itself in detail as well as extend and modify simulations we perform: we have taken one of the key attributes of humanity and extended it.

Computers are making us as a people. We are growing as individuals and as a society because of them. You are not what you could be if you have not learned the basics of programming [10] and the practical use of computers. We live in the computer era.

Notes:
[0] Though that is what make Western nations so awesome. You want to whine about our society? Go for it - that is your right, and we have also created the wealth that enables you to spend time doing this. Just don't take the little niggles at the corners too seriously: our society has many flaws, but it is amazing. The fact you - that you can - spend time whining about your pet peeve is a wonderful development.
[1] And then what? Is perhaps the greatest and most interesting question - we made computing machines, and then they were used for communications. The internet was not the goal, but it was the destination we discovered.
[2] The side effects and "and then what" are often complained about - take nuclear weapons as an example - but confronting the ideals, potential, and meaning is what drives our evolution as a society. Do you seriously think we are better off without the bomb? The bomb is neutral. Our reaction to the bomb has matured and developed us. The fact is we are smarter and more developed as a society due to the bomb. Now, how much has the bomb endangered us? Do we even know? What is the odds of drastic climate change? Of an asteroid slamming into earth? That someone will use many, many bombs repeatably on "us"? We don't even have a context to compare the world pre- and post- bomb: have we significantly increased the danger to ourselves? Have we lessened it? The fact we simply don't know suggests that perhaps we should not get too worked up.
[3] I find that students pre- and post- programming undergo a transformation in their ability to think. I don't mean pre- and post- programming class, as I have met people who have 1st year programming courses yet do not know about commenting code, debugging, and other aspects (apparently it is "too hard" to mark this stuff, so they skip it and just get you to submit code that is tested for (1) compiling and (2) giving answers), but pre- and post- programming practice. As in you want to learn programming and you try to learn it. But I digress.
[4] Being forms of symbolic manipulation for the purpose of crystallizing meaning.
[5] You have heard of deliberate practice - practice that is systematic, focused, and measurable. The measure is key - if you can't quickly see your results you can simply lock-in bad habits and incorrect assumptions.
[6] Hamming notes that a couple orders of magnitude of change modifies change from "by degree" to "by kind". If something is 100 cheaper this qualitatively changes everything, and all the old assumptions are gone. Computers routinely change things by orders of magnitude.
[7] Okay, not all, but basically all...
[8] At approximately the same time philosophy no longer equaled science and all other things; once we split from generalists to niches of disciplines the philosophers were left with all the boring and irrelevant stuff, and basically comment on the fruits and results of the productive disciplines and arts.
[9] I include cognitive science and linguistics here, as I believe computer science "writ large" is the study of possible processes.
[10] Everyone should learn to program. Everyone should learn to program. It does not matter if you never write a line of code post sitting down to work through a book. To be properly educated you must know the basic concept. I only have the very basics down, and have done very little programming - but I have grown a lot from my few exposures and will be looking to learn more.