Python3 with type annotations
It is common to start students with a procedural subset of a statically typed language such as Java or C#.
Students may be better served by learning the procedural part of Python (free of Java OO scaffolding/mechanisms that only complicates the task) --- as their first language.
Python3 has a relatively simple and consistent syntax, a large standard library – and using Python in a beginning programming course permits students to concentrate on important programming skills such as loops, procedures (functions and modules), problem decomposition, data type design and testing the correctness of their programs. Type annotations adds significant benefits for checking program correectness
-
For procedural constructs, Python has a relatively simple and consistent syntax, a large standard library -- and using Python in a beginning programming course permits students to concentrate on important programming skills such as loops, procedures (functions and modules), problem decomposition, data type design and testing the correctness of their programs.
-
Python is also a popular language (Python Is Now the Most Popular Introductory Teaching Language at Top U.S. Universities). The first 11 chapters of the MIT text by Guttag is an example of a good textbook using Python. There are many good texts now.
-
Thanks to the interactive command line, students may obtain immediate feedback, and can study individual commands in isolation, without worry about full-scale programs. There is no code-compile-run cycle, and, initially, there is no need to use files or classes or other overhead that commonly cause beginners unnecessary headaches. As an example, if they can’t remember the methods for a list, they can do the following from the command line:
>>> L = []
>>> dir(L)
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']
>>> help(L.append)
Help on built-in function append:
append(...)
L.append(object) -- append object to end
>>> L.append(1)
>>> L
[1]