[prev in list] [next in list] [prev in thread] [next in thread]
List: python-edu-sig
Subject: [Edu-sig] C++ As a First Language
From: tim_one () email ! msn ! com (Tim Peters)
Date: 2000-02-29 7:18:54
Message-ID: 000801bf8285$3d0a2700$732d153f () tim
[Download RAW message or body]
[Jason L. Asbahr]
> Most readers have probably seen this already, but there is a
> fascinating interview with Stroustrup on Slashdot, in which
> Bjarne asserts that, yes, indeed, C++ *is* a great first language.
> :-)
>
> http://slashdot.org/article.pl?sid=00/02/25/1034222&mode=thread
His paper is at:
http://www.research.att.com/~bs/new_learning.pdf
It's interesting reading, but is overwhelmingly concerned with why C++ can
be easier to teach than C, and C is really the only other language
considered. Here's his first example:
int main()
{
using namespace std; // gain access to standard library
cout << "Please enter your first name:\n";
string name;
cin >> name;
cout << "Hello " << name << ´\n´;
}
While equivalent C is truly a mess (mostly because you can't know in advance
how much space to allocate for "name"), it's prophetic that this first C++
example doesn't compile: main is declared to return int but lacks a return
stmt. My Python version compiled the first time <wink>:
name = input("Please enter your first name:")
print "Hello", name
although-at-this-level-you-may-as-well-teach-basic-ly y'rs - tim
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic