Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any reason to use C?

Author: Robert Hyatt

Date: 19:48:01 08/01/03

Go up one level in this thread


On July 31, 2003 at 19:46:29, Russell Reagan wrote:

>On July 31, 2003 at 18:20:47, Matthew White wrote:
>
>>I realize that they are essentially the same. The reason why I lean towards Java
>>is the fact that if you read past the end of an array in Java, you get an
>>ArrayOutOfBounds exception with the line number where the exception occurred. In
>>C/C++ you get the obscure "Segmentation Fault (core dumped)." That scared the
>>hell out of me as a student, having no clue what a core was... I just think that
>>Java is a friendlier intro...
>>
>>Matt
>
>Surely fellow students, TAs, or the professor could have explained what a
>segmentation fault was and why it happened in your program. So I don't think
>that's a valid reason to prefer java. Besides, I think there are languages that
>have better error descriptions than java if that's your aim.

Actually, this has been a criticism forever.  In 1970 we were using IBM
fortran compilers (fortran G and fortran H depending on how much memory the
machine had).  Students hated them.

For students we used WATFOR, which was (a) a load/go compiler that was much
faster and (b) it gave precise run-time errors referring to a specific source
program line number.

Poor diagnostics is not a characteristic of the _language_.  It is a
characteristic of the _compiler_.


>
>I also wonder which is better in the long run. Wouldn't it be better for you to
>have the initial "shock" of seeing a segmentation fault, then learn what it is
>and why it happens? I think that thinking java is better because you don't have
>to deal with real world issues does more to hinder than help. If you and the
>professors followed that same line of thinking throughout your schooling, you'd
>go to work fresh out of school and *then* you'd see a segmentation fault and now
>instead of getting a bad grade on one homework, you lose your job.
>
>Maybe java is better than C as a very first language, but that isn't a very good
>reason to use it as a first language IMO, because there are plenty of languages
>that are more beginner friendly than java, and I don't think finding a perfect
>beginners language is necessarily a great advantage anyway. BASIC would probably
>be significantly easier to learn than java, just like java might be easier to
>learn than C because you don't have to worry about segmentation faults, but in
>the long run I don't think it's a good idea for everyone to take their first
>programming steps in BASIC, because you can develop some bad habits.
>
>I agree with Bob. It's best to learn what you're going to use first, regardless
>of what that is. For most people it will probably be C/C++. If you don't learn
>it well, that is either your fault for not being a good student, or the
>professor's fault for not teaching it well. IMO, that's kind of like saying "C++
>is a bad language because I don't know how to use it."



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.