My brother is turning 14 in a few days. He's pretty good at math. I think he should learn the dark art of programming. When I was his age, every computer had BASIC and life was easy. Where should I start the boy now?124 responses total.
C
Awk.
(does he know Turtle?) [something about this question reminds me of when my dad tried to give me the "birds ands bees" talk. I was 16 at the time and I remember remarking to him that there still might be time to give the talk to my little brother, who was 6.]
python.
8086 Assembler.
Python.
Tcl/Tk
(Let me clarify. Introduce him to scripting first, get him hooked, and then move him up (down?) to programming. First one's free, you know.)
This response has been erased.
Hehe, me, sadist? You hurt me, Dan ;) Seriously, I started with BASIC, which is basically defunct, and then was tauht Pascal - total waste. Learnt a bit of C on my own, but never really worked with it. I think in terms of usefulness, C is right up there. And once you know C everything else just seems so much simpler.
<remmers hesitantly suggests Java>
python.
I was going to say Java, but C's better ;)
This response has been erased.
This response has been erased.
Snobol60
At 14, learning BASIC would be an insult to his intelligence (I started at 10). If you want to teach systematic programming with little structure, and absolutely no OOP, try COBOL. (Yes, you can be totally unstructured in COBOL. Heard of GO TO. I've seen that abused most in COBOL than any other language Iv'e worked with.)
14 was when I did my first coding, and it was in C. However, I really liked the way UMich's CS100 did it: teach logic first, then move up to assembly (motorola 68k), then up to C. Unfortunately, lots of people didn't agree, and they've totally dropped that class.
This response has been erased.
i might even have my 68k book at home still (I wouldn't be able to check until Xmas, of course); you're welcome to it, but on your own for hardware. (Actually, probably easier to find an emulator somewhere than to bother with hardware...) I probably have the text from that class as well.
This response has been erased.
re #9: (I wasn't exactly suggesting Turtle. [does anyone still bother
with it in this age?] I should have been more clear: I already
knew Turtle by age 8 and knew Basic by age 9. thus, the
implication of my other comment: if Jamie's brother is
almost/already 14, doesn't he already know how to program in a
simple language by now?)
["lisp." pshaw.]
I did my first coding in Burroughs 205 machine language, circa 1960. (Yep, machine language - no assembler available. And the Burroughs was a mainframe.) I'm not as quick as Jamie to dismiss OOP for a first language.
This response has been erased.
This response has been erased.
That I highly doubt.
This response has been erased.
lol Now there's a skill that's really useful.
To get someone starting out with "programming" enthused, immediate gratification is needed. BASIC is certainly good at that, however ancient its programming constructs are. "Programming" a web page with html and including javascript can also provide quick feedback. I would say to get him hooked on the idea of software construction, before immersing in a disciplined environment requiring compilation, packaging, etc.
This response has been erased.
This response has been erased.
This response has been erased.
This response has been erased.
I recommend python.
Too much structure might be frustrating, but a language with at least some is important. I originally learned to program in BASIC and aquired a fair number of bad habits I had to unlearn. I think at some point everyone should have to program in a language like Pascal that enforces proper structure and strong typing, because when you switch to a language like C that doesn't have those "guardrails" you can get in trouble in a hurry if you're sloppy.
Kevin suggests html/javascript...I'd say skip straight over javascript to PHP. Getting your brother into web-based stuff would have its advantages in general, though. For one thing, learning programming for its intrinsic value requires having an interest in programming's intrinsic value. Learning to program so as to make a dynamic webpage allows you to motivate your learning with something extrinsic. Your brother might not be interested in learning to program but might be interested in learning to program for the sake of making a cool dynamic webpage for one of his existing interests.
Good thought. PHP is likely to be more engaging than a command-line script language because you can immediately do things a kid is likely to find interesting. Dynamic web content is fun.
I'd recommend an OO language as well, such as Java or (less favored) C++. I'd imagine python would do as well, but I'm not familiar enough with it to recommend. Reasoning: in most of these languages, it's pretty easy to write procedural code, then graduate to OO when you're ready. I think that starting with a toy language like Basic (or even worse, Visual Basic) does no one any favors, since they're addictive. They are watered down enough taht using them for any length of time causes your understanding of the scope of what's possible in a programming language to shrink. Yes, I say this from experience: my day jobs for the last four years or so have involved Visual Basic, and if I don't supplement work with some serious programming on my own time, I start to become noticeably dumber.
I suggest COBOL. It has clear, English-like syntax and will be very useful to know when all of these mainframers retire.
I recommended Turbo C
Listen, just listen to me. You once said I was the second most intelligent person, jp2, on Grex, and that should have some sway. Python.
This response has been erased.
I think I'd have to know the kid a lot better to make any useful suggestion. The best language to learn is whatever the kid is either most interested in, or that best fits the interests he has. If he's not willing to spend a lot of time obsessing about stuff, he's probably not going to become a real hotshot programmer in any case. Personally, I'd consider lisp, perl, C, assembler, or python to all be potentially good choices. I wouldn't pick java; it creates as much complexity as it solves, and I'm not at all convinced it's the right paradigm. C++ instead of C might be useful if that's where you want to end up, because yes, if you're switching from C to C++ there's stuff you have to unlearn. But I don't think any of these count for anything against what the kid wants to learn.
COBOL. It'll be like he's taking English.
I've heard that in today's IT job market it's sometimes considered a negative to have COBOL on your resume. Any truth to that?
Probably. But a 14 year old isnt interested in today's job market.
In <= 25 words, what be PHP?
PHP is a Perl-like scripting language designed for embedding in webpages. Unlike JavaScript, however, it's executed on the server, not in the browser.
This response has been erased.
It depends on what job you're applying for. Contrary to popular belief, COBOL is still pretty much alive. Every industry has COBOL embedded somewhere, and it sure doesn't look like it's going to go away in the near future. Sure, the front ends will change and become more fancy, but hte actual business functionality is still COBOL. And what with the fact the old mainframers are going to retire some day, you'll need people to actually step up and do their jobs.
This response has been erased.
This response has been erased.
(Interesting, Dan. I think it belongs in the 'humour' item, though. Maybe.)
This response has been erased.
Yeah, it belongs here, too. ;/
COBOL was my bread and butter for 3 years ..I liked it ..but then it's not cool to know program in COBOL anymore :P
I don't think cobol and "interested in math" go well together. Cobol
was designed so that you could spell out "difficult" arithmetic so that
your manager could understand it:
ADD A TO B GIVING C.
This is unlikely to impress most math geeks. apl might be more
interesting.
Granted, perl has many warts. It does appear to also be used by
mathematicians for various things, and is in fact a pretty good fit for
the kinds of things many mathematicians do -- in part because it has a
disturbing number of features "borrowed" from lisp and only lightly
disguised. I don't think perl would necessarily be my first choice, but
I don't think it's an automatically bad choice.
This response has been erased.
Python.
I think Perl is a terrible choice for a first language. He would never be able to use anything else.
re 41 WHERE did he say that?
Lisp or Scheme
Re #60: I've heard people make the same argument about BASIC. But yeah, Perl probably isn't structured enough. Perl also has a lot of "behind the scenes" default actions, like default parameters, that make it really difficult to read other people's code. That's not good if you're trying to learn to program.
Exactly. Basic at least has the virtue of being a simple language, even if it's not very structured. So there's only so confusing it can get. Perl was written for hackers, so it's convoluted and cryptic as all hell.
This response has been erased.
I don't think sed can really be called a programming language.
I agree that Perl would be a bad idea, and especially agree with the second reason cited in #63. Sometimes it seems like Perl doesn't just encourage awful programming style, it practically enforces it..
This response has been erased.
FORTRAN isn't a bad choice if you plan to go into a science or math research field.
Gah. Backtalk is being really flakey today. I keep having to re-enter my password over and over. One reservation I have about languages like FORTRAN, COBOL, or Perl is that I wonder what you can do with them that a kid will find really interesting. None of them have any graphics capability, for example.
This response has been erased.
COBOL does have some graphical capability. At least MF Cobol did. I was surprised at what cld be done with Cobol when I worked with it. Sure it's a little cumbersome, but it's still there. (I remember you can make a bell ding with Cobol, this was when we learnt it back in college, I know it's not grpahical, but it's still cool)
putchar('\007');
The first language I learned, when I was 15, was BASIC on my TRS-80 Color Computer. It had some built-in graphics capability, and as long as you didn't want anything finer than a 32x64 pixel grid, plotting things was very easy. So I had a lot of fun, first working through the tutorial book that came with the computer and then writing stuff on my own. I wrote games and function-plot programs, mostly. At the end of the BASIC tutorial book was a bit about assembly language, and descriptions of memory addresses you could poke to get higher-resolution graphics modes. So eventually I graduated to writing fancier stuff in BASIC and then Assembler.
That's sort of the tragectory I followed, though I ended up playing with several computers...an XT clone and a VIC-20 at home, and an Apple //e at school. The //e was my introduction to assembly language. It had a built-in machine language monitor and mini-assembler.
Maybe the answer is BASIC on some crufty little early 80's home computer, then. ;)
If you are rating languages by "what they do" perl has got to be near the top of any rational list. The biggest advantage of a popular kitchen-sink language with excellent "import" tools is that if you can imagine any plausible interface, somebody has probably already done it. Anybody got some rotten tomatoes?
This response has been erased.
I'm currently working on contract that requires me to write a lot of Java code in a J2EE environment. This is the first time I've worked with Java. string.length() vs. array.length long vs. Long javax.rmi.PortableRemoteObject.narrow() InputStream, ByteArrayStream, FileInputStream, FilterInputStream, BufferedInputStream, DataInputStream, PushbackInputStream, ObjectInput Stream, PipedInputStream, SequenceInputStream, Reader, BufferedReader, LineNumberReader, CharArrayReader, FilterReader, PushbackReader, InputStreamReader, PipedReader, StringReader I say, hit it with a stick. Objects are supposed to hide complexity. But the Java library objects glory in introducing huge amounts of needless complexity, none of which you can ignore. It probably doesn't help that I'm fixing code written by programmers of dubious quality, who declare variables "long" or "Long" at random. This shouldn't be anyone's first language. Since we are still trying to get this person interested in programming, it should be something you can easily get some cool results with. Probably something like PHP or python, but I've never used either language so I don't really know. Learning object oriented languages early is probably a good idea - except it so rarely seems to work. Many of the people I've seen who started with object oriented programming are still worse at it than I am. Procedural thinking dressed up in minimal object oriented dressing.
This response has been erased.
This response has been erased.
This response has been erased.
This response has been erased.
#82, rephrased slightly: "Yeah, that's what I was going to say, but you beat me to it!". ;)
To expand on one issue a bit, "long" and "Long" are both long integers. The
difference, as I understand it, is that "long" is a primitive type, while
"Long" is a "long" encapsulated in an object. The most obvious difference
is that a "Long" can be "null". "Longs" also have some handy methods attached
to them. I have two problems with all this. First problem is with the
original authors of the program I am working on who declare variables and
parameters either as "long" or "Long" depending on their mood at the moment.
Second problem is with the language. If "a" is a "long" and "z" is a "Long"
then we have the following
ILLEGAL CORRECT
a= z; a= z.longValue();
z= a; z= new Long(a);
if (z < 0) if (z.longValue() < 0)
or if (z < new Long(0))
If you do any of the things at the left, the compiler will tell you it
cannot convert a java.lang.Long into a Long or vice versa. It won't just
shut and do it. If you want to support two views of a long, primitive type
or object, that's fine, but make it seamless so you can switch views
seamlessly instead of peppering the code with syntactic garbage functions
like Long.longValue().
Perl is certainly an ill-begotten nightmare of a language, but I've
developed a lot of respect for it. Whatever else you can say about it,
it never get's in the programmer's way. Everything that should be easy
is easy. If you're thinking "there must be an easier way", there is.
If it's true that if a new programmer starts with Perl, then he'll never
be able to learn anything else, is that a problem with Perl, or with
everything else?
Re #79: A year or so before I left Michigan Tech switched from teaching freshman CS majors C to teaching them Java. That struck me at the time as a terrible mistake, but I don't know how it's worked out in practice. Re #85: Make them learn a fascist language like Pascal first, so they suffer like I did. Then when they learn Perl they'll APPRECIATE it, damn it! ;> Of course, for the first few days someone should stand behind them and apply a mild electric shock whenever they try to debug a program without using either the -w flag or "use warnings;".
This response has been erased.
This response has been erased.
Pascal is fine for illustrating algorithms and programming principles. Lots of good programmers started out learning Pascal in college. Jamie doesn't want to teach his brother programming principles, though. He wants to get him interested in learning how to make simple programs that do something. Jamie's brother probably envisions himself writing an improved version of Doom as a starting project, then moving into virtual reality games when he has a few weeks of experience. He needs something he can start with and get results he can see reliably, and which results are entertaining to a 14 year old boy. I don't know of anything like that myself. In a few years I'll be looking for it too, so I'm interested in what Jamie comes up with for his brother.
Re #87: I was mostly joking about "suffering" with Pascal. I used QuickPascal (the Microsoft clone of Turbo Pascal) for quite a while, and in my current job I've done some programming in Borland Delphi. Pascal isn't a bad language, you can do useful work with it, and it does teach good habits. Re #89: A friend of mine recommends BlitzBASIC. It's a BASIC variant that's tailored for game programming. The webpage is here: http://www.blitzbasic.com/
I "hesitantly" suggested Java a number of responses earlier, mainly because it's widely used and implements the object-oriented paradigm, which I do think is appropriate for beginners. My first and only serious brush with Java involved teaching a course in it for beginning programmers last semester. Thought it went pretty smoothly. With careful planning and guidance by the instructor, the complexity can be tamed. I haven't had experience with Java beyond what's necessary to teach a beginning course though and so haven't run into the frustrations that Jan's experiencing all that much. On balance he's probably right -- it's not the best language for beginners to study on their own, although with appropriate guidance from an instructor, it can work. One aspect that hasn't been addressed so far in the discussion of language choice is the "social factor". I assume that Jamie's brother isn't a hermit who plans to hole up in his room with a language textbook and a computer, never to see the light of day for the next couple of years while he makes himself into a guru. If he's studying on his own, he'd probably benefit more from a language that's got lots of online support (e.g. tutorials, programming examples) and that his more computer-literate friends might actually have an interest in too. From that point of view, Lisp and Ada tend to lose (fine languages though they may be), and Perl and Python are better choices, warts and all. (If intrinsic merits of the language were the sole criterion, I'd be pushing Simula-67, the original OOP language.)
This response has been erased.
(I humbly retort that there are any number of skills that are best learned with a guidance of a teacher, and that this does not diminish in the least their appropriateness for students.)
This response has been erased.
I wasn't greatly impressed with Java's string handling; it had all of the same complexity as Jan complains about with integers, and more. I think people learning Java are going to be learning more about the complexity and resulting annoyance factor than they will about any advantages of OOP. I think perl would actually make a better learning environment for those advantages, although I might choose python, C++, or perhaps even Lisp first.
This response has been erased.
This response has been erased.
This response has been erased.
Kerl.
C++ has more *visible* complexity. But individual things implemented in C++ can be less complicated than the same stuff in Java, because Java adds gratuitous complexity and provides less flexibility. I don't know that "bad features" are necessarily the absolute evil Dan Cross paints. To some extent, it's *useful* to have a language that lets you do the wrong thing, because then you learn more of what's happening and why it's important. If you use a language that makes it impossible to make certain mistakes, you won't necessarily learn not to make that mistake, and you certainly won't learn how to recognize the mistake or fix it. You'll never learn, in Java, how to track down a memory allocation error. And nothing in Java will prepare you for the absolute horror of an array overrun that wipes out random unrelated memory in "neighboring" memory. Of course this adds to the complexity and potentially the stress of the person learning. That can be either good or bad depending on the student. But if that's where the student wants to wind up, it's probably better to address such pitfalls early, and teach methods to recognize and avoid such, than to toss it all in at the end and hope the student doesn't notice.
I actually liked learning C (which was mixed with learning vi, which was not fun at all), since as a language it's pretty close to the hardware. Same as BASIC on a little 80's computer, actually. As computer language and practice became more abstracted from the hardware I enjoyed it less, and that's a big part of my software burnout. If the kid in question is more of a hardware type I'd really recommend C, and to fool around with interfacing or something. For all the web "programmers" who got laid off, hardware geeks came out a lot better.
Re #95: I remember the main realization I came away with in my C++ class was that compilers are often broken, and people will go to great lengths to get them to work anyway.
Heh, I remember frustration with broken compilers for C++ too. They've come a long way since then, and I'm pretty happy with modern gcc versions. I think that while C++ has a ton of complexity, it's possible to deal with it like an iceberg, leaving 90% of the crap out of sight until you really need it. The library works decently for simple tasks, with some warts. My worst complaint with C++ is that when something goes wrong, it can be mind-crushingly difficult to figure out what's wrong, even for small programs. I don't think there's much benefit to teaching object-oriented programming to students right off the bat. The benefits of OOP are almost all pretty arcane, and a beginning programmer might memorize the arguments, but he/she won't really understand them without having some experience of procedural programming to put it in context.
C is still the language I'm happiest programming in.
This response has been erased.
Forth.
I programmed in C++ professionally too. I don't quite agree with cross, but I do think it's better to learn C before C++. I think the real benefits of object oriented programming don't manifest themselves in small projects; they really show up in large projects with lots of programmers. So to a kid writing on his own, C++ would just look like so much beaurocracy, with no real upside.
This may be a bad analogy, but consider this: No one drives to work on a tricycle. But to get a child interested in "motion on wheels", we don't hand him keys to a car or motorcycle, or give him a 2-wheeler (bicycle): We give him a tricycle, so that he can obtain skills in balance, steering, braking, etc. So don't worry about having the teenager start in on a programming language that he'll be required to master in a job, get him "hooked" by something fairly easy to pick up, and - I maintain - something that provides quick feedback. Thus I still recommend BASIC or html & javascript.
I will confess that my own path to computer science (which commenced after I got a PhD in mathematics) began with Basic (original Kemeny version out of Dartmouth, late 1960s). At that point, I'd had a little experience with programming in connection with a computer operator summer job that I had while in college. But that had been years earlier, with the machine language of a computer that nobody used anymore. I was a professional mathematician but a novice programmer. I had some math problems whose solutions I wanted to automate. Vintage Basic enabled me to do that without mastering a lot of language bureaucracy first. Later I came to see the value of more sophisticated langauge features, but then I just wanted to get something working with a minimum of fuss and bother. The simplicity and quick feedback of Basic facilitated that. So I'm inclined to agree with Albaugh.
This response has been erased.
I think it depends partly on what the kid wants to do. If you try to teach him a language that doesn't do anything he finds interesting, he's going to lose interest quickly.
A few people with poor balance commute on tricycles.
And some of us still program in BASIC!!! :-)
re 113 wtf??
I mostly stopped programming in BASIC when I reached puberty. ;>
I had at one point an old (and i mean old) conputer, don't ask what it was called but it was the one after commodore (a something) it used a tape player to run it's programs. It only worked in basic so I inadvertentley learn't it, that was when I was about 7 or 8. Shame i forgot it all but i didn't reliase what it was. Damm!.
Sounds like one of them TI "hook it up to your TV" units...
I quite like ruby these days. Wish it had been around when I was learning object-oriented programming.
Are you related to Brian Howard, Bruce?
Our paths have crossed from time to time :-) (Hey Bri, how's Mom doing? Tell her I send my love...)
No way, you're brothers? Where does Jamie fit in?
speaking as one who has taken introductory programming classes at three different colleges in two languages, I wouldn't recommend Java to anyone for anything, least of all as a first language. As others have said, it's just simply too complicated and intorduces too many things which are unnecessary to learning the fundamentals of how to program. C++ wasn't much better. Personally, actually, I like LISP. LISP is pretty; I wish I had time to learn more of it. If he's more interested in web stuff, I'd say go with PHP.
True story: Napster's distribution system is modelled after Chinese whore-rings.
I am also new to programing and I am thinking of going with java.
You have several choices: