Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any reason to use C?

Author: Robert Hyatt

Date: 08:23:46 07/31/03

Go up one level in this thread


On July 30, 2003 at 17:46:35, Gerd Isenberg wrote:

><snip>
>
>>>>Depends on your ultimate goal.  If you are going to be a programmer, it is
>>>>not the best way to go.  If you program in Java for 4 years, then leave and
>>>>go to work where they use C, you have a _long_ learning curve.  You've never
>>>>seen pointers, for example.
>>>
>>>Bob, that may be true - but if they do Java in their job, the learning curve is
>>>rather short, if not zero.
>>
>>I already said that.  But for large IT organizations, Java is not an
>>option.  C/C++ and COBOL are dominant, still.
>>
>>
>>>
>>>In my working environment i found the trend goes to Java. Huge business
>>>client/server applications with Java application server like Bea and JBoss.
>>>I found Java-beans much more intuitive than C++ based component ware i used so
>>>far, but still a newbie in this field. Have you ever used COM (the better C++?!)
>>
>>No to COM...
>>
>>
>>>or MSXML-DOM with ms-smartpointer?
>>>
>>>I learned in the "bottom-up" way, from assembler close to hardware to Pascal and
>>>later C/C++. I had clear imaginations what an address or a pointer is.
>>>
>>>In the meantime with C++, i prefere the reference synonym instead of pointer,
>>>only because of syntax ( a=b instead of *a=*b, passing a,b instead of &a,&b and
>>>only a prototype with (int &a) instead of (int *a).
>>>Due to my career i'm not sure what's the "best" didactical way to teach "call be
>>>reference" or "call by pointer" first, may be very individual.
>>
>>
>>I learned assembly first, then FORTRAN and then others.  The point is that it
>>is far better to learn your main programming language (for your career) first,
>>rather than later.  Learning syntax is easy.  Learning semantics is not as
>>easy.  Experience to become a _good_ programmer in a specific language takes
>>_much_ longer.
>>
>>By the way, the two calling conventions are commonly called "pass by value
>>(where a copy of the value is passed, as in FORTRAN)" and "pass by reference"
>>(where a pointer to the value is passed).
>>
>
>
>i see, therefore references in C++ or pointer in C++ or C are both "pass by
>reference". Is it not the same semantic and only a different syntax?
>
>To be aware of the side effect if you write
>
>void foo(int &a) {...
> a = b;
>}
>
>The point of Dieter, because he dislikes references, is that with pointer syntax
>the side effect is obvious.


I don't see how C is "non-obvious".

IE you have to *x to actually use a pointer and de-reference it to get the
value it points at.  But that's just a matter of taste, probably.



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.