Good language for a 12yo to learn with?

bdazzled

Junior Member
May 9, 2013
6
0
0
My 12yo son has been wading into simple programming in his spare time. He's working on an old-school-style text adventure game with a rudimentary combat system, buying and selling, and things like that. The first I knew about his project was when he came to me for help debugging. I was both impressed and dismayed to learn that he had run up to 500 or so lines of code using MS Windows batch scripting 'language'!

I'd like to steer him into a language environment that would make it easier for what he's working on now, as well as opening up more possibilities as his skills grow (and making more sense as part of a learning path.)

I am not a computer professional. I learned BASIC as a kid and did a lot of math and scientific coding in the field of computational chemistry. I still do a bit of a shade-tree Fortran95/2k3 coding just for my own amusement. So clearly, I'm a decrepit old dinosaur, and have no idea what newer languages might be better for my son to learn. I want to encourage his development without killing the fun or de-railing him by forcing him to worry too much about 'under-the-hood' type stuff. I also don't want to just fall back the old "Well, I learned on BASIC, so you should too!" attitude.

I would appreciate any advice or suggestions. Thanks!
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
BASIC was what I learned first as well, but I'm not sure you should steer him anywhere at this point. He's done something pretty rare, which is to pick up the nearest tool at hand and start writing code. It's not a great environment, but he's learning the first simple concepts. Pretty soon he will exhaust what he can do with it, and want to move on of his own accord. Until then I think I would just let him continue to experiment and help where you can.
 

Merad

Platinum Member
May 31, 2010
2,586
19
81
If he's done that much with batch file scripting, then I'd say he definitely shows some promise! I would introduce him to Python, as he can probably handle it. Or if Python proves to be too much of challenge you could try Ruby.
 

Jaydip

Diamond Member
Mar 29, 2010
3,691
21
81
Start with C.It isn't the most user fiendly programming language out there but one of the most highly used and powerful.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Lua (Lua For Windows is a nice starter package)

It's dreadfully simple and powerful, lacks the dearth of complex add-ons that Python and such have, making it easier to learn advanced programming concepts with (more programming, less API memorizing and looking up to get in the way), supports eager functional programming styles as well as iterative imperative (IE, you can do things with it that you can't in Python), and it's used as a scripting language all over the place. Also, unlike Smalltalk (wait, what? :)), there's a huge user community--really, a huge number of small communities--and they aren't all hipstery.

It's also designed to be both extended (by modules) and integrated (as a contained scripting language), using C or C++ (part of why it's so widely used), so if learning C or C++, he can get into the habit of pushing high-level non-performance-critical stuff out of it, and focus on the rest of the program, once the integration work is done (just like commercial games do :)). Lua has everything a language needs to make it fun to learn and use, and a serious side to go along with it.

Python and Ruby are good languages to get work done in, but they lose the fun factor fairly quickly, as far as the language goes (Python has become a business language, so in many ways, it's not GvR's fault, but you won't do much without add-ons, so that's how it is, today), though Ruby is the far more interesting language, of the two.
 
Last edited:

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
I used to advocate python or ruby because they are good clean languages that kids can do interesting things in. But I actually think JavaScript is a good choice now. We have v8 and other standalone javascript engines and when its running a browser you can now do 3d graphics and around and all sorts of cool stuff. Its a language everyone needs today and its everywhere and easy to get going with.
 

TakeNoPrisoners

Platinum Member
Jun 3, 2011
2,600
1
81
Learn C++, C is too old and outdated. The ability to use classes will be very important especially if he wants to make more complex games.

If all he ever wants to do is make text based games there are other languages that are much simpler that can accomplish what he wants much easier.
 

Net

Golden Member
Aug 30, 2003
1,592
2
81
javascript would be a fun beginner language. he could show all his friends if you put it up on a domain for him. bluehost.com/promo
 
Last edited:

Ajay

Lifer
Jan 8, 2001
15,628
7,954
136
I still think Java is a great starter language for someone who shows aptitude. Understanding OOP really helps beginners develop more complex structures and develops higher order thinking. Plus he can use Java2D to make some more complex games if he is so inclined. IMHO.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
I still think Java is a great starter language for someone who shows aptitude. Understanding OOP really helps beginners develop more complex structures and develops higher order thinking. Plus he can use Java2D to make some more complex games if he is so inclined. IMHO.
My experience with Java has entirely the opposite: that learning to program in Java causes people to, more often than not, spend most of their mental energy on Java+libs, rather than their code's more important semantics (I think Python is becoming this way, now, too, though it wasn't several years ago), and I would defy you to find any beginner that can understand OOP at all, regardless of language. Personally, I don't think OOP will ever make sense to anyone, until they make better code by using it than not, doubly so for languages, like Java, C#, and C++, that primarily only support templating and inheritance (though it seems C++ is determined to implement static polymorphism--some stones may very well have blood in them!). Luckily, my 1st-level CS courses were not my introduction to programming, but going to Java for them was a complete failure at my school, and Java has only gotten even more complicated since then (though the GUI libraries aren't bad, these days).

Higher-order thinking generally comes from having problems that need it, IME, regardless of language. Languages that support higher-level features make it easier (such as Haskell, any LISP, Erlang, etc.), but the problem is really where that comes in. In BASIC, pretty much as batch files, it may be hard, but most any good structured programming language will be as good as any other, in the end.
 

wirednuts

Diamond Member
Jan 26, 2007
7,121
4
0
My experience with Java has entirely the opposite: that learning to program in Java causes people to, more often than not, spend most of their mental energy on Java+libs, rather than their code's more important semantics (I think Python is becoming this way, now, too, though it wasn't several years ago), and I would defy you to find any beginner that can understand OOP at all, regardless of language. Personally, I don't think OOP will ever make sense to anyone, until they make better code by using it than not, doubly so for languages, like Java, C#, and C++, that primarily only support templating and inheritance (though it seems C++ is determined to implement static polymorphism--some stones may very well have blood in them!). Luckily, my 1st-level CS courses were not my introduction to programming, but going to Java for them was a complete failure at my school, and Java has only gotten even more complicated since then (though the GUI libraries aren't bad, these days).

Higher-order thinking generally comes from having problems that need it, IME, regardless of language. Languages that support higher-level features make it easier (such as Haskell, any LISP, Erlang, etc.), but the problem is really where that comes in. In BASIC, pretty much as batch files, it may be hard, but most any good structured programming language will be as good as any other, in the end.

WOOOSH! i feel very ignorant right now^_^
 

exdeath

Lifer
Jan 29, 2004
13,679
10
81
Even after Java I'm still a C++/assembly junkie.

I did something similar when I was learning GW BASIC around 7. Similar text adventure but with actual pictures like Shadowgate on NES. Before I understood the concept of loading/saving data, file formats, and memcpy operations, I did all my graphics and sprites with MASSIVE blocks of hard coded hand typed GW BASIC PSET/LINE commands as subroutines that were called with an x,y position any time I wanted to draw something...

Any time you changed rooms it took like 10 seconds for the screen to refresh and the new scene to render... Eventually I moved on to DATA/READ and started to mess with primitive blitting with GET/SET and PEEK/POKE but by then I started learning assembly in DOS debug.exe and abandoned BASIC after experiencing the euphoria of feeling like a god with the new found power of native assembly language.

I recall spending an entire evening with a magnifying glass to my original Gameboy running Final Fantasy Legend II and translating the tile pixel art to graph paper and entering them into GW BASIC as LINE/PSET commands...

/facepalm

One of my fondest bits of code to come out of my childhood:

10 OUT INT(RND*65536), INT(RND*256)
20 GOTO 10

That and sticking a second 8086 into an 8087 cop socket thinking it would make my computer twice as fast are the two highlights of my childhood computing experiences.
 
Last edited:

exdeath

Lifer
Jan 29, 2004
13,679
10
81
Personally I'd direct him to using pre-fab game maker software like RPG maker or something. Plenty of experience there using scripts but he can focus on actually making a game rather than programming an engine.

Hes going to learn quickly like all aspiring game programmers that games are not built with programming but with art assets.
 

bdazzled

Junior Member
May 9, 2013
6
0
0
Thanks for all the thoughtful suggestions. You've all given me some angles to consider, so I'm off to explore the array of choices you've provided. I will share this thread and the results of my research with my son, and try to select a good fit based on what his goals are. I wish I knew more about programming myself, since I have absolutely no formal training, just some numerical methods courses (mostly using disgustingly terse f77) and hundreds of hours spent with binders of documentation to get results out of Fortran and bash. So sadly, I wouldn't know a static polymorphism from a dynamic array allocation. :(

At the risk of revealing myself as an utter philistine, I admit that as a beginner, I avoided applying myself to C variants, because (A) I found the syntax opaque and cluttered with punctuation and (B) the added learning effort just didn't seem necessary for what I wanted to do. So it kind of resonates with me when Cerb says:
Higher-order thinking generally comes from having problems that need it
I'm afraid my son has not gotten to the point where advanced data structures, classes or hierarchies would make sense to him as a learning investment. Not that he's lazy, but he might react to these concepts as bewildering complications until he's had more experience. (He does seem to be running up against the limitations of the robust-ever-extensible-and-expensively-maintained MS .bat environment though, Markbnj! ():)) Also, I'm a bit worried about not being able to help him much, other than in terms of general programming and logic, when he runs into difficulties.

That said, I'm willing to PEEK/POKE my head out of my comfort zone a bit and get a feel for the suggestions you've given me. I'm looking at Lua now, and will do some research on java/js and python and rpg-maker too, to start with. Since I don't want to learn all these languages myself just to get my boy set up, I'll try for a birds-eye view of each, their strengths, focus, and drawbacks, and then look at a selection of code-samples to get a feel for 'how they roll.'

Again, thanks for your time and help!
 

dagamer34

Platinum Member
Aug 15, 2005
2,591
0
71
I learned C++ at 12. I think your son could do it. However, what's really more important isn't the language itself but how languages in general work (which is why CS courses have a lot of theory). The more languages he learns, the better.

An adept programmer can pick up a programming book and learn a language in a weekend, and master it in a month or so.
 

nickbits

Diamond Member
Mar 10, 2008
4,122
1
81
I started with c around 12. I tried to jump into c++ but it was too much initially. I like the JavaScript idea.
 

Broheim

Diamond Member
Feb 17, 2011
4,592
2
81
I'd suggest C#, good allround language that is fairly easy and surprisingly powerful. It's very polished and so are the tools (free versions are available if he doesn't have access to dreamspark).

I personally like C#, it doesn't annoy me like java and isn't as hairy as c/c++.

the most important thing you can do is teach him how to program, the language honestly comes second.
 

Syran

Golden Member
Dec 4, 2000
1,493
0
76
I started with BASIC on a C64, personally, avoid it and derivatives. If you are dealling with line numbers for another more then (there is a problem in line 12) then you won't be a happy camper later.

My first real foray into programming was Pascal, I don't think I can even code in Pascal anymore, as the last time I touched it was '95. BUT, I don't think it's a horrible language for one reason: It does (imho) a nice job of teaching fundamentals of coding & DOCUMENTATION.

From that, I moved on to Assembly, C/C++, and very basic HTML. Ididn't do any programming for a long time as I ended up on the cisco/network admin side of the house. Started getting back into HTML in 2001-2, and have added a fair amount of PHP and JS to my code. I still hate reading people's JS, as no one ever seems to document any of it worth anything, and I'm not a fan of how they open and close the functions. I'm OCD about indentions in my coding.

Anyway, I would try to stick with a fairly "structured" system just for a while, before beginning to broaden my horizons. To me, the first few months of coding will set your style for the rest of the time; it's a horrible habit to try to break bad coding habits. Oh, and DOCUMENT! Often, more if needed.

One of my favorite profs was the one I had when I first learned C and C++. We typically had a 4 part major programming project every quarter in his class that counted for about 40% of our grade. Of which 25% was graded by our peers. We would write the code for each part, then turn it in. The prof would remove our names from it, and then redistribute the code to others, we would then do the next piece of the project on someone elses code. When we turned in the code, we also turned in a grade for how we felt the other person documented the code (we didn't do a grade for how it handled, just how it was documented).
 

Ajay

Lifer
Jan 8, 2001
15,628
7,954
136
Higher-order thinking generally comes from having problems that need it, IME, regardless of language. Languages that support higher-level features make it easier (such as Haskell, any LISP, Erlang, etc.), but the problem is really where that comes in. In BASIC, pretty much as batch files, it may be hard, but most any good structured programming language will be as good as any other, in the end.

Pedagogically, that's just not true. We don't learn Algebra because basic mathematics is calling on us to solve problems that can't be done with basic math. We learn Algebra because our instructors knew that it will make some problems more easily understood once we learn the basic concepts of Algebra and because they know that this more abstract branch of formal mathematics will open up new problem domains as we master it. It's a proactive system rather than a reactionary one.

I know that once one is out there practicing as a real software engineer that we sometime learn things just because we need a better solution to a problem and we are more heavily constrained by time (necessity is the mother of inventions sort of thing). But good professionals like yourself keep current in many subjects in our profession so that we are prepared to adopt new methods, languages, algorithms, etc. when the need arises.

Basic is not normally considered a structured language. Pascal would be a better example. I assume you know this and just didn't express it in your comments.

As far as what is best for our budding programmer; Java may be too much right now. The reality is that I don't know how he thinks. Pascal really caught my attention (after writing in BASIC for few years) because I finally had a language that allowed me to put the structures that my mind tended to create into code. Same thing as I advanced on to C++ and Java. What is correct for bdazzled's son - I guess an educator would best answer this question. I'm probably the worst choice and will refrain from answering these types of threads in the future.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Pedagogically, that's just not true. We don't learn Algebra because basic mathematics is calling on us to solve problems that can't be done with basic math. We learn Algebra because our instructors knew that it will make some problems more easily understood once we learn the basic concepts of Algebra and because they know that this more abstract branch of formal mathematics will open up new problem domains as we master it. It's a proactive system rather than a reactionary one.
Agreed. More to the point I was trying to get at, I guess: while it's all dynamic and you're changing the language left and right, are you really going to solve problems in LISP, that you won't solve in Java*? There will be less code, few design patterns to care about, and it will be easier to hammer it out, making it much easier for one person to focus less on the system they're working with, and more on the program at hand. But, you can make a program doing the same thing. Learning different paradigms can very much help, since they allow you to apply theory, but the big thing is being able to work with the data, mentally, and apply that to a limited language (IE, I think everyone should learn LISP, but I'll be happy if I never need to make a serious program with it, or worse, have to work on somebody else's :)).

Having to work with its intricacies can really get in the way. Once that's just a normal thing to deal with, it can be gotten beyond, and then it's annoying having to do all the boilerplate (but, whether necessary or not, it seems we can get either make good use of the CPU, or write less code, but not both). But, until that becomes easy to read and implement, it can be much harder than with languages that have less boilerplate, and less language-expressed categorization, and much more mental effort goes into Java, as a language, than would have gone into, say, C, Python, Javascript, or Lua, until a certain level of complexity is reached that all that categorization (in this case, Java's OO type system) actually makes it easier.

Basic is not normally considered a structured language. Pascal would be a better example. I assume you know this and just didn't express it in your comments.
Cerb said:
In BASIC, pretty much as batch files, it may be hard, but most any good structured programming language will be as good as any other, in the end.
I did make that caveat.

* Due to widespread support, you can probably do much more in Java that you can't in LISP, regardless of the language itself.
 
Last edited:

smakme7757

Golden Member
Nov 20, 2010
1,487
1
81
I would have said download Visual Studio Express and get him started on Visual Basic .NET. It would give him a nice and easy programming language to move into that supports more advanced techniques as well as a simple and intuative way for him to make a GUI. It might even make the learning experience more fun when he can represent it graphically.

I know the purests hate VB, but it was where i started and it had a nice learning curve. /shrug
 

Jaydip

Diamond Member
Mar 29, 2010
3,691
21
81
I would never recommend VB.Net as the starting language.It isn't bad but I wouldn't pick it as my first.
 

bdazzled

Junior Member
May 9, 2013
6
0
0
Well I was at the public library today with my 4yo (I had thought about naming him SQL but my wife frowned...oops there's no smiley for a 'rimshot'.) Anyway, I found they had a decent beginner book on Python, so I got that for my son, and he has been working through the 1st 6-or-so chapters this afternoon. He seems quite absorbed and the new syntax doesn't seem to bother him at all. So I'm encouraged by that.

I don't want to throw too much at him at once, but rather let him work his way through this Python book, then maybe see what I can find for C# or Lua or JS or even VB. Hopefully, he'll get enough depth to deal with the projects he's working on, as well as starting to imagine new possibilities. With exposure to a couple different languages (we have a long summer vacation coming up after all) I expect he'll learn more about the general practice of programming (not least the inclusion of plentiful comment lines and documentation—at least if he wants Dad to help with debugging!) I don't plan to rush him along or anything, just let him delve into Python and try to be attuned to when he's ready to try something else.
 

Ajay

Lifer
Jan 8, 2001
15,628
7,954
136
I did make that caveat.

* Due to widespread support, you can probably do much more in Java that you can't in LISP, regardless of the language itself.

Yes you did, my bad. I did learn e-Lisp for Emacs. I wrote dozens of e-Lisp 'Macros' that added some really cool features to Emacs (X-Emacs). That is all the 'Lisp' I ever want to learn ;) I cannot even conceive of writing any program longer than 1000 lines in Lisp - more gosh darn parentheses than 10,100 lines of Java or C++ :p