-
May 31st, 2013, 08:10 AM
#16
Re: Heap Corruption during run time.
but there's no reason why the java approach can't be applied to C++ just as easily. C++ viewn as just "C with objects", without the STL, without templates and without all the other things that separate it from it's granddaddy C (C++ has since evolved on it's own path not even following C anymore) is a concept that is outdated by many years now. THis might have been a useful approach when nobody knew C++ and C++ was still little more than a preprocessor for C. But it's gone way beyond that now.
It's like teaching someone to drive a car... By first telling them how to tend to a horse and making them drive around in a horse carriage for a whole year.
Even if you did teach the class by first teaching C, and then migrating over to C++, this assignment is bad because it makes not much sense if you look at it from a C p.o.v. and it's silly as a C++ p.o.v. because you're better off using STL.
I'm not saying there is no merit to teaching someone how to write a container, but then you'd do this because you want to do something STL doesn't provide and even then you'd make sure that students know about ths STL approach to things, so that the container they need to design is usable with the rest of the STL algorithms etc. (hardly a beginners class but hey).
-
May 31st, 2013, 08:54 AM
#17
Re: Heap Corruption during run time.
but there's no reason why the java approach can't be applied to C++ just as easily.
Agreed, but try getting the teachers to do this!
PS I think the benefit of the java approach is starting to filter through as there is now an 'early object' version of the well known Deitel 'c++ How to program' book that also covers c++11 (although I haven't yet seen a copy so can't comment upon how good it is).
http://www.amazon.co.uk/How-Program-...0008707&sr=1-2
Last edited by 2kaud; May 31st, 2013 at 09:08 AM.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 31st, 2013, 10:10 AM
#18
Re: Heap Corruption during run time.
Originally Posted by 2kaud
Agreed, but try getting the teachers to do this!
Then you get those who will say "but C++ programmers who learn the "high-level" way without learning the low-level details first will not be good programmers".
The problem with that statement is that this "C++ programmer who doesn't know low-level details" doesn't exist, or I have yet to meet such a programmer. It's plain foolish to think that a C++ programmer who knows how to use design patterns, STL, boost, MFC, etc. to structure a well-written, modular, easily maintained program can't manipulate a few pointers or know how to use char*, dynamically allocated memory, strcat or strcmp() properly.
Regards,
Paul McKenzie
-
May 31st, 2013, 10:26 AM
#19
Re: Heap Corruption during run time.
Originally Posted by Paul McKenzie
Then you get those who will say "but C++ programmers who learn the "high-level" way without learning the low-level details first will not be good programmers".
But if you are using c++ 'correctly' - ie high level - how often do you need the low-level detail? IMO if you are regularly using the 'low level detail' (unless you really are twiddling bits) then you are not using c++ properly.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 31st, 2013, 10:52 AM
#20
Re: Heap Corruption during run time.
Originally Posted by 2kaud
But if you are using c++ 'correctly' - ie high level - how often do you need the low-level detail? IMO if you are regularly using the 'low level detail' (unless you really are twiddling bits) then you are not using c++ properly.
I know. But you still get those responses from die-hards who believe that teaching low-level details should be done first.
So the way I counter their argument is to show me this (mythical) C++ programmer who, if need be, can't write a module or get involved in some low-level coding. So far, no such programmer can be produced.
Regards,
Paul McKenzie
-
May 31st, 2013, 01:37 PM
#21
Re: Heap Corruption during run time.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 31st, 2013, 05:10 PM
#22
Re: Heap Corruption during run time.
Frankly guys, how is the OP to benefit from the last posts? I feel that many threads ends up in a a lot of posts that blame the teachers of teaching the wrong stuff and giving the wrong type of excercises but that's not what the board is about is it? Shouldn't every post be focused on trying to help the OP the best we can?
-
May 31st, 2013, 06:32 PM
#23
Re: Heap Corruption during run time.
Originally Posted by S_M_A
Frankly guys, how is the OP to benefit from the last posts? I feel that many threads ends up in a a lot of posts that blame the teachers of teaching the wrong stuff
I'm still waiting for the OP to post the other functions instead of descriptions of what he/she did. That is what I asked for, and so far, nothing.
Also, a test program to see how these classes and functions are being used and called wasn't posted so we see what the flow was that ultimately led to the crash.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; May 31st, 2013 at 06:37 PM.
-
May 31st, 2013, 07:24 PM
#24
Re: Heap Corruption during run time.
Originally Posted by Paul McKenzie
I'm still waiting for the OP to post the other functions instead of descriptions of what he/she did. That is what I asked for, and so far, nothing.
Also, a test program to see how these classes and functions are being used and called wasn't posted so we see what the flow was that ultimately led to the crash.
Regards,
Paul McKenzie
I agree with S_M_A. Railing against the nature of the assignment doesn't really help the student. We who have been doing it for a while, know how goofy some of these assignments are, but the student is still required to implement them.
Regardless, I pointed out what I think is the likely cause in post #2. It would be kind of nice if the OP would comment on that.
-
June 1st, 2013, 04:44 PM
#25
Re: Heap Corruption during run time.
Maybe we should ask for a "What C++ teachers should teach and why" forum (and of course the other langauges as well)? After all, we all do represent the industry and we do know what we want people that just graduated to know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|