Programming@School sucks

A

Andreas Marschke

Ok folks its story time:
Being a new fresh-faced employee student in a new city I have to go
to school twice a week. This is law hear as the company you work in
is supposed to give you a practical basis for your career while the
school should give you the theoretical basics for your career.

My Job can roughly be translated to "IT Specialist for
Systemsintegration". Or sysadmin I suppose fits the bill.

I chose this because I wanted to keep my joy and fun in C/C++ coding
alive not having it induced and forcd down my throat through work or
anything. (And partially because I did'nt feel right as a programmer
on a sallery. Having had an internship in which I wrote Delphi code
for a Legacy system.)

Well here begins the horror. I come here all enthusiastic hearing
that we will get C/C++ in school and that it would be an interesting
treat.
But what I discover right in my first lesson was disgusting and a
shameless vomit inducing sign of incapabillity of educational staff
to even comprehensibly show students a good style of C or C++.

First shock he came across to me with: There is a boorland , a
windows and a Linux compiler.
First pile of dogshit right on the plate. What he was referring to
here was:
Borland Compile: Bloodshed's Dev++ (gcc with mingw32)
Windows Compiler: Visual C++ (THE IDE)
Linux Compiler: probably gcc?
Cutting a long story short: he is an embarrassment.

AND NOW THE BEST PART:
First C in this lesson:
#include <stdio.h>
int main(int argv,char* argc[])
{
printf("Hello World!\n");
system("PAUSE");
}

Please vent below...
 
A

Alf P. Steinbach /Usenet

* Andreas Marschke, on 19.09.2010 06:00:
Ok folks its story time:
Being a new fresh-faced employee student in a new city I have to go
to school twice a week. This is law hear as the company you work in
is supposed to give you a practical basis for your career while the
school should give you the theoretical basics for your career.

My Job can roughly be translated to "IT Specialist for
Systemsintegration". Or sysadmin I suppose fits the bill.

I chose this because I wanted to keep my joy and fun in C/C++ coding
alive not having it induced and forcd down my throat through work or
anything. (And partially because I did'nt feel right as a programmer
on a sallery. Having had an internship in which I wrote Delphi code
for a Legacy system.)

Well here begins the horror. I come here all enthusiastic hearing
that we will get C/C++ in school and that it would be an interesting
treat.
But what I discover right in my first lesson was disgusting and a
shameless vomit inducing sign of incapabillity of educational staff
to even comprehensibly show students a good style of C or C++.

First shock he came across to me with: There is a boorland , a
windows and a Linux compiler.
First pile of dogshit right on the plate. What he was referring to
here was:
Borland Compile: Bloodshed's Dev++ (gcc with mingw32)
Windows Compiler: Visual C++ (THE IDE)
Linux Compiler: probably gcc?
Cutting a long story short: he is an embarrassment.

AND NOW THE BEST PART:
First C in this lesson:
#include<stdio.h>
int main(int argv,char* argc[])
{
printf("Hello World!\n");
system("PAUSE");
}

Well, it seems that it's much the same up to and including the level of Ivy
League universities (see e.g. my article "Some errors in MIT's intro C++
course", posted in this group on the 8th this month).

I guess that quality C++ teaching can be found at Texas University.

After all, Bjarne's there. ;-)

But it's not necessarily the teacher's fault. When I taught C++ at Bodø College
in the mid 1990's it was not my choice. And I was poor (as always) and couldn't
afford a computer where I could do 32-bit stuff; I bought second-hand PCs from a
colleague. Preparing a curriculum and lecture notes and exams and so on took a
lot of time, and somehow I was manouvered into being responsible for a very
in-practice oriented course with ~180 students, and although I had a bunch of
lab assistants to help out it was an extreme work load, while at the same time
introducing a brand new course in Windows programming (I'm sort of proud of
that) and helping to set up a network and "virus" lab. I guess, after initial
great success turning their introductory programming course from catastrophe to
success (before I came it was based on programming on Nord 100 computers from
the eighteen-hundreds or so, I changed over to PCs and Borland Pascal and better
textbook), they probably thought well if Alf can handle that, then he can handle
this too, and this... There was no time at all to teach myself the finer details
of the language, and anyway I was exhausted, every day.

And I think there was some politics involved, because the textbooks I'd ordered
didn't arrive until long after they should, and ditto for Visual C++ compilers.

And so I had to teach the first part of the course without textbooks. I can't
recall what I did about the practice side. But it was messy, and much work.

Then it happened that the department and some kind of student organization was
organizing a kind of conference/workshop in C++ programming, and I was cajoled,
in a good-natured way, to help out with the practice sessions.

One of the participants asked about how to read a line of input. That's basic,
but I hadn't focused on the standard library much, and it took some time before
"getline" popped into my head. That's when I started to sweat. Profusely.

Next came a question about virtual calls in constructors. I explained as best I
knew, based on my experience with Borland/Turbo C++, and perhaps also Visual C++
1.5 (I'm not sure about that). Anyway, with the C++ compilers I was familiar
with a virtual call went down to the most derived class, as in Java today.
However, the guy asking me knew better! I almost panicked, one very trivial,
basic question I almost couldn't answer, and one that I answered incorrectly --
I was sure of that by the guy's expression -- uh oh!

Happily the people participating were very pleased with my help in general, it
seems they didn't notice the few blunders, and the student org gave me a silver
knife (I still have it) and an honor membership. I guess the silver knife said
I'd done OK, and the student org membership that I still had much to learn...


Cheers,

- Alf (lifetime learner)
 
J

Juha Nieminen

Andreas Marschke said:
system("PAUSE");

This seems to be an extremely common idiom, seen many times even in
this very newsgroup. I wonder where it's coming from and how it has got
that widespread. Seemingly completely unrelated people are using it,
so they must have learned it from somewhere. I wonder what the source is.
 
G

Geoff

If you think you know something about a topic. Try to teach it.
It is only then that you learn what you didn't know.
 
J

James Kanze

* Andreas Marschke, on 19.09.2010 06:00:
I guess that quality C++ teaching can be found at Texas University.
After all, Bjarne's there. ;-)

Just a nit, but that's Texas A&M, not Texas University. (I
don't know if there's a Texas University, but there's a
University of Texas, where Dijkstra taught. Which is not the
same as Texas A&M.)

And Bjarne's most recent book, based on (I think) his experience
teaching there, is probably the best teaching book I've seen for
any language.
 
J

James Kanze

This seems to be an extremely common idiom, seen many times
even in this very newsgroup. I wonder where it's coming from
and how it has got that widespread. Seemingly completely
unrelated people are using it, so they must have learned it
from somewhere. I wonder what the source is.

It's a system specific work-around for a design error in the
Microsoft debugger.
 
O

osmium

Christian Hackl said:
Juha Nieminen ha scritto:


I think the source is DevC++ inserting the line by default when you create
a new project.

No, it won't compile in DevC++, which is as I expected. system() is in
stdlib.h (or cstdlib) and is not declared in the program posted. I always
use cin.get() as the library is almost always there for other reasons. I
just noted now, as I write this, that there is an additional reason that I
missed on my initial scan, to dislike the code. It is C, not C++.
 
O

osmium

Christian Hackl said:
osmium ha scritto:


Presumably Dev-C++ also adds #include <stdlib.h> by default. I'm fairly
sure it inserts the system() call to make its "execute" button work (for
some definition of "to work").

Or at least it did a few years ago when I last used the IDE.

I'm not sure I got all the "good" out of your post. But a cut and paste of
the program into DevC did not work in the five minutes before my post.
 
O

omr

* Andreas Marschke, on 19.09.2010 06:00:




Ok folks its story time:
    Being a new fresh-faced employee student in a new city I have to go
    to school twice a week. This is law hear as the company you work in
    is supposed to give you a practical basis for your career while the
    school should give you the theoretical basics for your career.
    My Job can roughly be translated to "IT Specialist for
    Systemsintegration". Or sysadmin I suppose fits the bill.
    I chose this because I wanted to keep my joy and fun in C/C++ coding
    alive not having it induced and forcd down my throat through work or
    anything. (And partially because I did'nt feel right as a programmer
    on a sallery. Having had an internship in which I wrote Delphi code
    for a Legacy system.)
    Well here begins the horror. I come here all enthusiastic hearing
    that we will get C/C++ in school and that it would be an interesting
    treat.
    But what I discover right in my first lesson was disgusting and a
    shameless vomit inducing sign of incapabillity of educational staff
    to even comprehensibly show students a good style of C or C++.
    First shock he came across to me with: There is a boorland , a
    windows and a Linux compiler.
    First pile of dogshit right on the plate. What he was referring to
    here was:
         Borland Compile: Bloodshed's Dev++ (gcc with mingw32)
         Windows Compiler: Visual C++ (THE IDE)
         Linux Compiler: probably gcc?
    Cutting a long story short: he is an embarrassment.
    AND NOW THE BEST PART:
    First C in this lesson:
    #include<stdio.h>
    int main(int argv,char* argc[])
    {
         printf("Hello World!\n");
         system("PAUSE");
    }

Well, it seems that it's much the same up to and including the level of Ivy
League universities (see e.g. my article "Some errors in MIT's intro C++
course", posted in this group on the 8th this month).

I guess that quality C++ teaching can be found at Texas University.

After all, Bjarne's there. ;-)

But it's not necessarily the teacher's fault. When I taught C++ at Bodø College
in the mid 1990's it was not my choice. And I was poor (as always) and couldn't
afford a computer where I could do 32-bit stuff; I bought second-hand PCs from a
colleague. Preparing a curriculum and lecture notes and exams and so on took a
lot of time, and somehow I was manouvered into being responsible for a very
in-practice oriented course with ~180 students, and although I had a bunch of
lab assistants to help out it was an extreme work load, while at the same time
introducing a brand new course in Windows programming (I'm sort of proud of
that) and helping to set up a network and "virus" lab. I guess, after initial
great success turning their introductory programming course from catastrophe to
success (before I came it was based on programming on Nord 100 computers from
the eighteen-hundreds or so, I changed over to PCs and Borland Pascal and better
textbook), they probably thought well if Alf can handle that, then he can handle
this too, and this... There was no time at all to teach myself the finer details
of the language, and anyway I was exhausted, every day.

And I think there was some politics involved, because the textbooks I'd ordered
didn't arrive until long after they should, and ditto for Visual C++ compilers.

And so I had to teach the first part of the course without textbooks. I can't
recall what I did about the practice side. But it was messy, and much work.

Then it happened that the department and some kind of student organization was
organizing a kind of conference/workshop in C++ programming, and I was cajoled,
in a good-natured way, to help out with the practice sessions.

One of the participants asked about how to read a line of input. That's basic,
but I hadn't focused on the standard library much, and it took some time before
"getline" popped into my head. That's when I started to sweat. Profusely.

Next came a question about virtual calls in constructors. I explained as best I
knew, based on my experience with Borland/Turbo C++, and perhaps also Visual C++
1.5 (I'm not sure about that). Anyway, with the C++ compilers I was familiar
with a virtual call went down to the most derived class, as in Java today..
However, the guy asking me knew better! I almost panicked, one very trivial,
basic question I almost couldn't answer, and one that I answered incorrectly  --
  I was sure of that by the guy's expression  --  uh oh!

Happily the people participating were very pleased with my help in general, it
seems they didn't notice the few blunders, and the student org gave me a silver
knife (I still have it) and an honor membership. I guess the silver knife said
I'd done OK, and the student org membership that I still had much to learn...

Cheers,

- Alf (lifetime learner)

This was a nice story. If I was a teacher I would be more or less the
same, I guess :)
 
A

Andreas

It's a system specific work-around for a design error in the
Microsoft debugger.

What design error? When a console program is started, a new console
window is opened. When it stops the window is closed. The debugger
doesn't affect the program by default.

The cited line tries to keep the windows open by preventing an exit
from the main function. The call to cmd.exe with the "PAUSE" argument
is clumsy, but not a workaround for the debugger. If you need to stop
the program before if exits (and the windows is closed), you can add a
breakpoint on the closing bracket of main.

You may not like the idea that a console program opens and closes its
console window. But that's the Windows operating system you choosed.
Mixing up the debugger control with the application I/O as seen with
GDB is much more clumsy.

When you run the console program in an open console window, it doesn't
need a new window. In that case the output goes to the current window.
I think this works as expected, even if you would expect. Dont' you?

Andreas
 
J

James Kanze

What design error? When a console program is started, a new console
window is opened. When it stops the window is closed. The debugger
doesn't affect the program by default.

Running a program under the debugger, and not capturing its
output, is simply stupid. No one else does it. It can only be
considered a design error.
The cited line tries to keep the windows open by preventing an exit
from the main function. The call to cmd.exe with the "PAUSE" argument
is clumsy, but not a workaround for the debugger. If you need to stop
the program before if exits (and the windows is closed), you can add a
breakpoint on the closing bracket of main.

It has nothing to do with stopping the program. If the
debugger starts a program, it captures its output, either
directly or indirectly.

[...]
When you run the console program in an open console window, it
doesn't need a new window. In that case the output goes to the
current window. I think this works as expected, even if you
would expect. Dont' you?

Yes. So why doesn't the debugger do it that way, instead of
what it does? If the shell can do it, so can the debugger.
 
Ö

Öö Tiib

Yes.  So why doesn't the debugger do it that way, instead of
what it does?  If the shell can do it, so can the debugger.

Note that visual studio itself can do that too. Only not with debug
window. Not sure if it is design mistake or just evilness. Look at
Tools/External tools... dialog. It has "Close on Exit" check-box that
you have to tick if you want the tool console window to go away on
termination like debug console window always does.
 
J

James Kanze

Note that visual studio itself can do that too. Only not with debug
window. Not sure if it is design mistake or just evilness. Look at
Tools/External tools... dialog. It has "Close on Exit" check-box that
you have to tick if you want the tool console window to go away on
termination like debug console window always does.

For other tools, you can also click on the Use Output Window
check box, and not get the console window at all. All of the
console out goes to the Output Window in the debugger, and is
there for you to examine after the program has terminated.
That's what I'd expect when debugging as well; it's the way
every other debugger I've used worked.
 
D

Daniel Pitts

If you think you know something about a topic. Try to teach it.
It is only then that you learn what you didn't know.
Also, it is more important as a teacher to know how (and when) to look
something up. Answering "That's a good question, lets look it up in ..."

It is often good to do that, even if you *do* know the answer off the
top of your head. Your students will eventually learn that there are
answers out there, and they don't need to waste the classes time by
asking.

And these days, Google is your friend.
 
B

BGB / cr88192

Daniel Pitts said:
Also, it is more important as a teacher to know how (and when) to look
something up. Answering "That's a good question, lets look it up in ..."

It is often good to do that, even if you *do* know the answer off the top
of your head. Your students will eventually learn that there are answers
out there, and they don't need to waste the classes time by asking.

And these days, Google is your friend.

I once had a teacher who did this...

and also used personification for his books...


be careful what you ask... the teacher may just go into a long explanation
and end up looking up stuff in the dictionary in the process, ...

or such...
 
J

Jim Langston

Running a program under the debugger, and not capturing its
output, is simply stupid.  No one else does it.  It can only be
considered a design error.

I run programs by pressing ctrl-F5. Then the console output pauses
before it closes. I am not sure if it should be considered a design
flaw or not. That is subjective, but there are work arounds outside
of system("pause"); or any code.
 
D

Daniel Pitts

I once had a teacher who did this...

and also used personification for his books...


be careful what you ask... the teacher may just go into a long explanation
and end up looking up stuff in the dictionary in the process, ...

or such...
A good teacher would know when the tangent is useful. If (s)he deems it
not as useful for the majority of the class, (s)he should respond
"That's a good question, ask after class." or "I expect a report on
this topic by next week." :)
 
D

Daniel Pitts

I run programs by pressing ctrl-F5. Then the console output pauses
before it closes. I am not sure if it should be considered a design
flaw or not. That is subjective, but there are work arounds outside
of system("pause"); or any code.
Setting a break point on the last line of the program as well, which is
what M$ expects (for whatever reason).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top