Thread: [Dev-C++] Re: [q] Does C++ promote bad programming?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Defiant H. <he...@er...> - 2003-04-12 16:38:09
|
If you don't need to cover OOP, I'd suggest teaching plain C first. It's much simpler, and this will help the students learn some of the nuances of the language before moving to C++. |
|
From: Khalid El-K. <kha...@ho...> - 2003-04-12 21:12:31
|
read about multiple inheritance below.
> > -----Original Message-----
> > From: dev...@li...
> > [mailto:dev...@li...] On Behalf Of nada
> > Sent: Saturday, April 12, 2003 4:20 PM
> > To: dev...@li...
> > Subject: [Dev-C++] [q] Does C++ promote bad programming?
> >
> >
> > I'm interested in the opinions of the group.
> >
> > Is there anything in the C++ language which you feel inherently can
> > contribute to new programmers developing bad programming
> > habits? Is C++ an
>
>
>A programming language can't protect you from bad programming(!). For
>example one may have the bad habbit to do:
>
>
>
>template<class T>
>T add(T a, T b)
>{
> T c1=a, T c2=b;
>
> while(c1/a<2 && c2/b<2)
> c1++, c2++;
>
> return a+b;
>}
>
>
>int main()
>{
> int x=1, y=2;
>
> int z=add(x,y);
>}
>
>
>
>
> > inappropriate language for an introductory course, a course that is
> > designed to introduce learners to programming concepts, not
> > necessarily
> > prepare them for a programming career?
>
>
>In the contrary. C++ supports 4 paradigms and each one *well* and with
>optimal space/time efficiency. For example, in the OO paradigm it supports
>multiple inheritance. Few other languages do that (personally I do not know
>any other but I assume there is).
Python ... http://www.python.org
>
>
>So for example if you want to teach all the concepts of Object Oriented
>programming, C++ is a perfect candidate.
>
>
>
>
>
>Ioannis Vranos
>
>* Programming pages: http://www.noicys.freeurl.com
>* Alternative URL 1: http://run.to/noicys
>* Alternative URL 2: http://www.noicys.cjb.net
>
>
>Anti-racism movement: http://www.positive-youthfoundation.org
>Iraq Peace Pledge: http://www.peacepledge.org
>
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
>for complex code. Debugging C/C++ programs can leave you feeling lost and
>disoriented. TotalView can help you find your way. Available on major UNIX
>and Linux platforms. Try it free. www.etnus.com
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
|
|
From: Shayne K. <err...@ne...> - 2003-04-12 21:40:19
|
This might have been mentioned before, but just in case, here is my view on C++. First of all, C++ is a tool. And as any tool, you use it appropriately with the problem. I think the first mistake new programmers make is the 1 tool fits all paradigm. Though, this is not specific to C++. The other thing I see is poor design. This is easy to do in C++ since you can implement your application however you want. There is nothing stopping you from not using classes/inheritence/etc. Though, this brings me to another point, mostly about not using the tools in C++ to its full advantage. C++ has many useful tools, STL, Templates, multiple inheritence, Strings, exceptions, etc. And finally, take a C coder and make them write a C++ application. I remember when I did this and I just wrote my C++ applications as C. They compiled, but again, they didn't use C++ to its full advantage. I think over all if you use good design and write a C++ app correctly, the efficiency will be the same as writing it in C (for example). If you want to learn C++, learn it. But take an OO methods course like intro to objects. - shayne http://www.shaynekasai.com On Sat, 12 Apr 2003, Khalid El-Kary wrote: > read about multiple inheritance below. > > > > -----Original Message----- > > > From: dev...@li... > > > [mailto:dev...@li...] On Behalf Of nada > > > Sent: Saturday, April 12, 2003 4:20 PM > > > To: dev...@li... > > > Subject: [Dev-C++] [q] Does C++ promote bad programming? > > > > > > > > > I'm interested in the opinions of the group. > > > > > > Is there anything in the C++ language which you feel inherently can > > > contribute to new programmers developing bad programming > > > habits? Is C++ an > > > > > >A programming language can't protect you from bad programming(!). For > >example one may have the bad habbit to do: > > > > > > > >template<class T> > >T add(T a, T b) > >{ > > T c1=a, T c2=b; > > > > while(c1/a<2 && c2/b<2) > > c1++, c2++; > > > > return a+b; > >} > > > > > >int main() > >{ > > int x=1, y=2; > > > > int z=add(x,y); > >} > > > > > > > > > > > inappropriate language for an introductory course, a course that is > > > designed to introduce learners to programming concepts, not > > > necessarily > > > prepare them for a programming career? > > > > > >In the contrary. C++ supports 4 paradigms and each one *well* and with > >optimal space/time efficiency. For example, in the OO paradigm it supports > >multiple inheritance. Few other languages do that (personally I do not know > >any other but I assume there is). > > Python ... http://www.python.org > > > > > >So for example if you want to teach all the concepts of Object Oriented > >programming, C++ is a perfect candidate. > > > > > > > > > > > >Ioannis Vranos > > > >* Programming pages: http://www.noicys.freeurl.com > >* Alternative URL 1: http://run.to/noicys > >* Alternative URL 2: http://www.noicys.cjb.net > > > > > >Anti-racism movement: http://www.positive-youthfoundation.org > >Iraq Peace Pledge: http://www.peacepledge.org > > > > > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger > >for complex code. Debugging C/C++ programs can leave you feeling lost and > >disoriented. TotalView can help you find your way. Available on major UNIX > >and Linux platforms. Try it free. www.etnus.com > >_______________________________________________ > >Dev-cpp-users mailing list > >Dev...@li... > >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > _________________________________________________________________ > The new MSN 8: smart spam protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Ioannis V. <iv...@at...> - 2003-04-12 17:53:18
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Defiant Heretic > Sent: Saturday, April 12, 2003 8:38 PM > To: dev...@li... > Subject: [Dev-C++] Re: [q] Does C++ promote bad programming? > > > If you don't need to cover OOP, I'd suggest teaching plain C > first. It's > much simpler, and this will help the students learn some of > the nuances of > the language before moving to C++. Although that is the path I followed myself, C is not prerequisite for C++, not to mention that they are very different languages right now. One can learn procedural programming in C++ directly and more easily than in C by using the standard library facilities. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |