# What is a good introductory language for high school?

I'm teaching introductory programming for high school. Back in the day, when I was starting out, DOS and Unix terminal prompt was normal UI, and console apps would spark kids interest.

Now, on the other hand, kids grow up on the web, and a console program would look quite uninspiring.

On the other hand, I'm not sure if JS (which is the web language) is a good introductory language. It's got a lot of gotchas which can confuse beginners, and I was thinking that a language like Python or Go would be a better introductory language.

On the other hand, they don't have much of a front-end, and I don't want to teach two languages at the same time.

What do people suggest?

• You may want to look at this related question or this one. Jul 9 '19 at 2:15
• I like python turtle. Jul 14 '19 at 17:45

If Advanced Placement CS is in their future, then Java is probably the best language choice as it is still used in APCS. There are also a lot of resources for Java development that also permit graphics based insight. The course probably wouldn't be about developing for the web, though.

But because of the APCS link there are a lot of resources intended for novice programmer development.

One resource (Java) that is very useful for such students, and has a lot of project ideas built in to it is Greenfoot, which uses a rectangular grid to place visual representations of objects and lets them move an interact according to the student program. There is also a dedicated teacher resource for it: Greenroom. It has additional greenfoot projects and a forum for discussion.

Otherwise, Python is a pretty good choice for beginners. It has less syntactic load. But the set of resources for novices is a bit more scattered.

But any programming that uses some visual metaphor is better for student understanding than just numeric programming. It needn't be web based, but should be graphical. Games are pretty good for this provided that they aren't just textual. Any simple board game can provide a nice way to visualize what a corresponding program needs to do.

But, one way to avoid the two language issue in web development is to have the students build only the back end or only the front end with you providing the other. It also defines a set goal that students can program toward. The part you build can be in a different language than that used by the students, of course.

• Java is a dreadful teaching language (not the worse). It has many problems, including keywords that have to be used before you can teach what they do “public static void main …” It also discourages object orientation “static …main”. I can't remember all of the other problem, but there are many. I have been teaching a student one-to-one, and I see many problems, because of the language. The last problem was trying to teach interfaces (Java and OO meaning don't match). Jul 14 '19 at 17:44
• Your opinion is not widely shared. Java is used in APCS and in many, many beginning collegiate courses. Also, see: cseducators.stackexchange.com/a/4718/1293 Jul 14 '19 at 18:10
• I 100% agree. However I suspect that it is the answer to “What language is popular in industry?”, or “What language do our instructors know?” and not “What is the best teaching language?” Jul 15 '19 at 8:36
• You don't actually have to use public, static or void without explaining them first to teach Java. As just one way to avoid it, BlueJ has been free and open source since 2009, and you can use the GUI to create an object and run a method named main (or anything else) without making it a proper program entry point. More recently, Java since version 9 comes with the JShell REPL which can be used in a similar way, though it has no GUI. I have taught Java as a first language, and left main until last. Feb 26 '20 at 14:37
• @Buffy The question's title was edited such that the meaning was entirely changed. Is that kosher? May 28 '20 at 22:15

I agree with Buffy that a great way to think about it isn't "language", but "language + library" or "language + provided code".

David Malan does a masterful job if this in his CS50 course, and anyone can see these labs. Those labe are impractically large-scale for someone without his staffing, but they give a sense of what is quite exciting.

Buffy's recommendation of Greenfoot is absolutely excellent. I have colleagues who use it this year, and they described it as one of the best pedagogical tools they've ever encountered.

I would also recommend looking into game engines. Unity allows you to create exciting projects from Day 1, and gives you an entry point into C#. Godot is great if you'd like a more Python-like language.

Finally, remember that these are merely starting points. Once the kids are up and running in the basics of the language (and enjoying themselves), you can take them out of the starting environment in almost any different direction. If you find it interesting, and present it with enthusiasm, they will usually be with you.

There is no better first line-code language than Small Basic. Lots of nice simple projects for beginners. Python and especially Java can be very intimidating to beginners and will scare away many kids. Small Basic is a step up from Scratch. There are a lot of beginner routes out there to get kids started. Another excellent language is Alice. I have my programming students build a scene from Shakespeare using Alice. If you have access to Lego EV3 robots Small Basic has an extension for them. There is also an EV3 extension for Visual Studio Code/Python if you want to step up to a more difficult language. Be careful what you start kids off with. Throw Python or Java at them you retain maybe 10% of the kids for the next class. I introduce Python in the 3rd semester. By then the kids are not intimidated by programming and problem solving techniques.

• What ages do you teach, out of curiosity?
– Ben I.
Jul 9 '19 at 15:38
• 9-12. Raw beginners to computer geeks that program for fun. Jul 10 '19 at 15:02

You might want to consider Visual Basic or Delphi where it is simple to create graphical user interfaces.

• Hello and welcome to Computer Science Educators. Would you mind editing to add some reasons why you think that those languages are good for this task? Jul 13 '19 at 11:45