Download Python should be taught in first-year Computer Science classes Joe

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

C Sharp syntax wikipedia , lookup

String literal wikipedia , lookup

Comment (computer programming) wikipedia , lookup

Programming language wikipedia , lookup

Object-oriented programming wikipedia , lookup

One-pass compiler wikipedia , lookup

Structured programming wikipedia , lookup

Control flow wikipedia , lookup

Lexical analysis wikipedia , lookup

Parsing wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Python syntax and semantics wikipedia , lookup

Indentation style wikipedia , lookup

Python (programming language) wikipedia , lookup

Transcript
Python should be taught in first-year Computer Science classes
Joe Shlabotnik, jks101
Python should be taught in first-year CS, because its syntax is simpler than other languages.
Simple syntax is important because students who are new to programming often have great
difficulty with syntax, and lowering this barrier will help them focus on learning algorithmic
concepts, which is the purpose of first-year CS.
Python is simpler than languages like C++ and Java, because Python is a scripting language, and
scripting languages have simpler syntax than system languages. In Python, statements are
terminated with an end-of-line, rather than a semicolon; block structure is indicated by
indentation, rather than with brackets. Simplifying these elements is valuable because
semicolons and brackets are common stumbling blocks for beginning programmers. For
example, the following code is a common bracketing error in C++ or Java:
if (x < 0)
cout << "x was negative";
x = -x;
However, the corresponding code executes as expected, since the indentation itself determines
the block:
if x < 0:
print "x was negative"
x = -x
Although Python's indenting rules provide a simple mechanism for determining a block, one of
the criticisms of Python is that students may have difficulty with the strict indenting rules.
Indentation, however, is not likely to be a problem, because current editors and IDEs for Python
provide extensive indentation support, such as automatic indenting and highlighting the current
block, as can be seen in the popular SPE editor shown in Figure 1.
In addition, researchers in the area of CS education have suggested that correct program
indentation is an important skill that should be taught early; Python's focus on indentation helps
students practice and master this skill from the start (Zelle, 2000).
In summary, Python's simple syntax, which allows students to focus on important concepts, and
its lack of substantial drawbacks, make it an ideal choice for first-year computer science.