Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Why Pascal?
Index -> General Programming
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Tue Feb 28, 2006 2:30 am   Post subject: Why Pascal?

I've been musing a lot recently on the topic of CS education. Just today I was wondering what reasons a person could possibly come up with that would justify teaching Pascal in the current computing environment.

So I had to think about weaknesses in the languages that would be its competitors. Weaknesses that Pascal does not share. Of course these are weaknesses from an educational perspective.

Let's look at Hello world in C++.

code:
#include <iostream>

int main()
{
   std::cout << "Hello world" << std::endl;

   return 0;
}


And in Java.

code:
public class HelloWorld {
   public static void main(String[] args) {
      System.console.println("Hello world");
   }
}


As I've said here many times before the problem here is that these languages utilize a fair number of advanced concepts in this very simple program. This increases the complexity of explaining such samples to students.

In fact, the more code we have, the more we have to explain. Thus, I prefer languages that makes the simple things suitably simple.

Ruby
code:
puts "Hello world"


Python
code:
print "Hello world"


O'Caml
code:
print_endline "Hello world"


But, these are often seen as too "edgy" for educators. I personally think that's an absurd position, but sometimes you have to just work with it. Pascal is sufficiently boring for many in the realm of education. So let's look at the Pascal version.

code:
program HelloWorld;
begin
   writeln("Hello world")
end.


Now, we're back to a fair amount of code to explain. But Pascal gives us some help.

With Java and C++ we have to explain why we have this mysterious "main" that looks just like any other function/method, but is different, and in fact contains the actual part of our program that gets executed.

Looking at the Pascal, it says "program." The keyword in this case better matches up to the intent of the programmer. Yes, that's basically what this article amounts to. One lousy, stinking keyword.

Still, it's an important thought. We need tools that allow for the most direct possible expression of the concepts we are trying to convey. If we find that a language poses some significant benefit in that regard, we should consider it honestly, and without interference from biases and old stereotypes.
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Tue Feb 28, 2006 10:51 am   Post subject: (No subject)

yes, I know I have liked pascal too when I learned it a little, cause it was similar to turing so it wasnt hard to grasp. Anyways, I think people should consider it for new programmers, cause java and C++ for really new programmers, just confuse them...
Display posts from previous:   
   Index -> General Programming
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: