what is an escaping variable
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.c++ Profile…
 Up
Re: Rusty's message to C++ programmers (C or C++)         


Author: Joe Greer
Date: May 6, 2008 05:52

Ian Collins hotmail.com> wrote in
news:68antgF2qkckmU14@mid.individual.net:
> dizzy wrote:
>> cr88192 wrote:
>>
>>> one has to give up many of the features, and is still faced with
>>> many of the other technical issues, that IMO one is better off just
>>> using C...
>>
>> I completely agree. Once you start dropping features from C++
>> (templates, exceptions, RAII, references, function and operator
>> overloading) then you get an incomplete language, some sort of "C
>> with classes" (the horror!) so you should better use C then.
>>
> Why would you have to drop templates, RAII, references, function and
> operator overloading in driver code? Exceptions typically require
> some form of run time support, but none of the other language features
> you mention do.
>
Show full article (1.55Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: Joe Greer
Date: May 6, 2008 06:02

Ian Collins hotmail.com> wrote in
news:68aeo1F2qkckmU9@mid.individual.net:
> Why omit constructors and destructors?
>

I would be interested in the answer to this myself. I know that in real
time systems they don't want the somewhat uncontrolled flurry of activity
that usually accompanies a method exit, however most OS's aren't real time
and I wouldn't think that it would matter in the main. Of course, you
can't really have dynamically allocated objects. You end up with a chicken
an egg problem there. That is, you can't use the memory subsystem to
implement the memory subsystem and all that. However, I personally create
a whole lot more stack objects than heap objects and that wouldn't be a
reason to ban objects entirely.

joe
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: malc
Date: May 6, 2008 07:21

Ian Collins hotmail.com> writes:
> dizzy wrote:
>> cr88192 wrote:
>>
>>> one has to give up many of the features, and is still faced with many of
>>> the other technical issues, that IMO one is better off just using C...
>>
>> I completely agree. Once you start dropping features from C++ (templates,
>> exceptions, RAII, references, function and operator overloading) then you
>> get an incomplete language, some sort of "C with classes" (the horror!) so
>> you should better use C then.
>>
> Why would you have to drop templates, RAII, references, function and
> operator overloading in driver code? Exceptions typically require some
> form of run time support, but none of the other language features you
> mention do.
>
> --
> Ian Collins.
Show full article (0.85Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: brad
Date: May 6, 2008 07:38

Raz wrote:
> So here is an expert of who believes that you don't need C++ to
> program low level. C++ brings extra complexity that is not needed. C
> is #1 language to program in lower level. We can also add that you
> don't need C++ to program in higher level either, as you can use
> easier and better languages such as C#, Java, Ruby on Ralis, Perl,
> Python.

I chose to learn C++ because of the options it provides... the
complexity that you refer to. I can do old-fashioned C, OOP, sequential,
functional, etc. I can do char arrays or use strings. I'm proficient in
Python and Ruby and I like them very much, but there are times when I
need native, compiled code for performance and efficiency reasons...
when that happens I normally use C++ in a C like manner. C++ does not
force me into a certain programming paradigm. That's what I like most
about it. I don't think it is a better C, IMO it's C with more
options... use them if you like, but you don't have to... and if you do
not need the additional options, then just stick with C. They are so
similar that it's not really worth arguing about.

Just my 2 cents,
Show full article (1.14Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: Erik Wikström
Date: May 6, 2008 08:56

On 2008-05-06 09:06, Chris Thomasson wrote:
> Use only explicit C++ POD, __NO__ STL, exceptions, constructor, destructors,
> virtual functions, inheritance, whatever... Every object is POD; ctor/dtor
> is explicit. POD templates would be allowed. You can still benefit from the
> syntax of the language - kernel unfriendly features.

Why limit yourself to PODs? Constructors and destructors can be useful
even in a kernel environment (probably the constructors more than the
destructors though). Virtual functions are also useful, in fact they are
used all over modern kernels (but implemented using function-pointers).
Inheritance can also be useful, I've seen some code like this:

struct Base {
uint16_t type;
};

struct Some_thing {
uint16_t type;
// more data
};
Show full article (1.26Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: Ian Collins
Date: May 6, 2008 12:33

malc@pulsesoft.com wrote:
> Ian Collins hotmail.com> writes:
>
>> dizzy wrote:
>>> cr88192 wrote:
>>>
>>>> one has to give up many of the features, and is still faced with many of
>>>> the other technical issues, that IMO one is better off just using C...
>>> I completely agree. Once you start dropping features from C++ (templates,
>>> exceptions, RAII, references, function and operator overloading) then you
>>> get an incomplete language, some sort of "C with classes" (the horror!) so
>>> you should better use C then.
>>>
>> Why would you have to drop templates, RAII, references, function and
>> operator overloading in driver code? Exceptions typically require some
>> form of run time support, but none of the other language features you
>> mention do.
>>
>
> Some of that is addressed here: ...
Show full article (1.01Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: malc
Date: May 6, 2008 14:11

Ian Collins hotmail.com> writes:
> malc@pulsesoft.com wrote:
>> Ian Collins hotmail.com> writes:
>>
>>> dizzy wrote:
>>>> cr88192 wrote:
>>>>
>>>>> one has to give up many of the features, and is still faced with many of
>...
Show full article (1.16Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: Ian Collins
Date: May 6, 2008 14:16

malc@pulsesoft.com wrote:
> Ian Collins hotmail.com> writes:
>
>> malc@pulsesoft.com wrote:
>>> Ian Collins hotmail.com> writes:
>>>
>>>> dizzy wrote:
>>>>> cr88192 wrote:
>>>>>
>>>>>> one has to give up many of the features, and is still faced with many of
>>>>>> the other technical issues, that IMO one is better off just using C...
>>>>> I completely agree. Once you start dropping features from C++ (templates,
>>>>> exceptions, RAII, references, function and operator overloading) then you
>>>>> get an incomplete language, some sort of "C with classes" (the horror!) so
>>>>> you should better use C then.
>>>>>
>>>> Why would you have to drop templates, RAII, references, function and
>>>> operator overloading in driver code? Exceptions typically require some
>>>> form of run time support, but none of the other language features you
>>>> mention do. ...
Show full article (1.24Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: peter koch
Date: May 6, 2008 14:30

On 6 Maj, 23:11, m...@pulsesoft.com wrote:
> Ian Collins hotmail.com> writes:
>> m...@pulsesoft.com wrote:
>>> Ian Collins hotmail.com> writes:
>
>>>> dizzy wrote:
>>>>> cr88192 wrote:
>
>>>>>> one has to give up many of the features, and is still faced with many of
>>>>>> the other technical issues, that IMO one is better off just using C...
>>>>> I completely agree. Once you start dropping features from C++ (templates,
>>>>> exceptions, RAII, references, function and operator overloading) then you
>>>>> get an incomplete language, some sort of "C with classes" (the horror!) so
>>>>> you should better use C then.
>
>>>> Why would you have to drop templates, RAII, references, function and
>>>> operator overloading in driver code?  Exceptions typically require some
>>>> form of run time support, but none of the other language features you
>>>> mention do.
> ...
Show full article (1.74Kb)
no comments
Re: Rusty's message to C++ programmers (C or C++)         


Author: Mike Schilling
Date: May 6, 2008 22:26

brad wrote:
>
> I chose to learn C++ because of the options it provides... the
> complexity that you refer to. I can do old-fashioned C, OOP,
> sequential, functional, etc. I can do char arrays or use strings.
> I'm
> proficient in Python and Ruby and I like them very much, but there
> are times when I need native, compiled code for performance and
> efficiency reasons... when that happens I normally use C++ in a C
> like manner. C++ does not force me into a certain programming
> paradigm. That's what I like most about it. I don't think it is a
> better C, IMO it's C with more options... use them if you like, but
> you don't have to... and if you do not need the additional options,
> then just stick with C. They are so similar that it's not really
> worth arguing about.

Note that function prototypes, which were a significant hole in C's
strong typing [1], originated with C++.
Show full article (1.45Kb)
no comments
1 2 3 4 5