🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #2050

Re: Should I learn C or C++ first?

#2050
From: vancleef
Date: Thu, 07 Sep 1995 07:02
63 lines
3313 bytes
In article <8biTwcM6hDXK083yn@encomix.es>, marauder@encomix.es (Marauder) writes:
> danker@hardy.ocs.mq.edu.au (Duncan Anker) wrote:
>> Marauder (marauder@encomix.es) wrote:
> 
>>: And replying to the subject, imho you shouldn't learn C++ before C.
>>: I choose between C, C++ and Asm for my projects. See?  C and C++. Some
>>: things are better to write in C and others in C++.
> 
>> To chuck in my <checks current inflation values and exchange rates> $5 worth,
> 
>   15$ by now..
> 
>> our university used to teach Modula-2 in the first semester and C in the
>> second semester. Now they teach C++ in first semester, as of this year, and
>> I have seen numerous students who understood C++ getting totally thrown.
> 
>    A friend has just finished uni. So I asked him some questions about
>    protected mode and some asm stuff. He told me that by now he hated
>    asm and the learnt by mind something about descriptor tables, but
>    didn't remember. Oh, and he thought that DOS4GW was a copy protection.
>    I got quite depressed ..
> 
>> For example, I was asked why some code didn't work. It was because the
>> variable was being declared in the middle of the function body, not at the
>> top. When I pointed this out, I was reminded that it's legal to do this in C++.
> 
>    But isn't it better to have all the vars at the top, commented, indented,
>    and initialized so you always know where to find them?

No. I prefer to control whether or not resources will be needed in
a routine. When you declare everything at the top you are executing all of
thosstack allocations. I prefer to control those stack allocations, and
being able to place a declaration in the code when I will actually
need it is useful for both speed and memory usage.


> 
>> I think it's far easier to learn C, and pick up the C++ extras later than it
>> is to try and do it the other way around. Teach people 'cout' and they'll
>> want to know why they have to use printf 6 months later...
> 
>    Yes, but the problem with C-->C++ is that people have problems in the
>    transition (me, him, her, ..) and start to write strange code without
>    a class and only couts and call it C++. Then you feel you don't like
>    or need it. And after some more C, you finally realize that "Hey, I
>    could do this via classes" and start to use C++ properly. Oh, I still
>    use cprintf instead of cout (I really hate it)
> 

Me too :)

>> C is also good for really small projects when you don't want code bloat ;-)
> 
>    Or to use assembler, inlined or called, doesn't matter.
> 
> 
> C++ya

-Garrett

>  ______________________________________________________________________________
> | marauder@encomix.es | Eastwood: Come on, make my day | Spanish/Danish Power! |
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID: <1995Sep7.030214.8090@ohstpy>
Path: arc1-ca.pugleaf.net!ohstpy.mps.ohio-state.edu!vancleef
References: <40o2ee$aqp@deyke3.fc.hp.com> <DDIE24.Hqw@info.uucp> <8biTwcM6hDXK083yn@encomix.es>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ohstpy.mps.ohio-state.edu!vancleef
From: vancleef@ohstpy.mps.ohio-state.edu
Newsgroups: rec.games.programmer,comp.lang.c++
Subject: Re: Should I learn C or C++ first?
Message-ID: <1995Sep7.030214.8090@ohstpy>
Date: 7 Sep 95 03:02:14 -0400
References: <40o2ee$aqp@deyke3.fc.hp.com> <DDIE24.Hqw@info.uucp> <8biTwcM6hDXK083yn@encomix.es>
Organization: The Ohio State University, Department of Physics