[try Beta version]
Not logged in

 
C++ Instructors

Pages: 123... 6
Dec 8, 2009 at 2:57am
Who certifies these goons? And what are they putting into these poor students heads? malloc() to allocate memory for a subclass instead of new?

I've seen such horrors on this site that it is amazing these students aren't crippled for life!
Dec 8, 2009 at 5:05am
Those who can, do. Those who can't, teach.
Dec 8, 2009 at 9:28am
closed account (z05DSL3A)
...and those that can't teach administrate.
Dec 8, 2009 at 12:48pm
Good students will quickly recognize the bad teachers and the good teachers. Crappy students... Well, they just don't really care one way or another.

I remember part of the registration ritual through college was to find out who the crappy teachers were (ever single Frat and Sorority had a list of them, and that list was available to any student whatsoever), and avoid their classes at all costs. That wasn't always possible though. For example, The organics of Chem class with the good teacher overlapped the Mechanics of Solids class with the good teacher my Sophomore year. I wound up taking Solids with a really crappy Eastern European prof (no dig towards Europe intended there).

The next semester I got stuck with the crappy Differential Equations prof.

In both cases, in fact in all cases, the students themselves had organized study sessions with students from the other classes. On the flip side of things, I've seen plenty of posts here from people who are obviously only making a last ditch effort to get an assignment done, and clearly don't really care about actually learning the material.

Besides, it's healthy experience for when they finally jump into the working pool if they ever end up with a goon for a boss. And that's always a very real possibility no matter what field you're in.
Last edited on Dec 8, 2009 at 12:49pm
Dec 8, 2009 at 3:30pm
It's probably because languages update so frequently, so when you switch between it's a hassle to rediscover the new conventions. Especially when you're being paid to teach the old ones.
Dec 8, 2009 at 5:34pm
What's wrong with malloc()? :(
I use it all the time, although in C++ I use new.
Dec 8, 2009 at 9:54pm
What's wrong with malloc()? :(
I use it all the time, although in C++ I use new.
Hurr durr. It's not like you have much of a choice in C.
malloc() doesn't call constructors.
Dec 9, 2009 at 8:39am
helios wrote:
It's not like you have much of a choice in C.

What? There's malloc, realloc, uhhhh... there's like an "alloc" for every single consonant in the alphabet...

malloc() doesn't call constructors.

Which makes it worse?

Hurr durr

Which reminds me; in a German exam yesterday one of the people in the exam was called "Herr Durr" (Herr is pronounced similar to "hair" in English; it means Mr.)
I'm getting kind of suspicious of the company that makes those exams. Another one featured someone called Wynn (pronounced like win) and the first sentence contained the string "lost the game."
Last edited on Dec 9, 2009 at 5:49pm
Dec 9, 2009 at 3:28pm
there's like an "alloc" for every single consonant in the alphabet


I only know of the 3:

malloc (allocates memory)
realloc (reallocates memory)
calloc (allocates memory then zeros it)
Dec 9, 2009 at 5:50pm
http://en.wikipedia.org/wiki/Exaggeration

There's also "talloc" if you've read K&R. Then again, that was specific to the book.

But never mind.

Why would you use realloc? What benefits would there be? Is it faster to reallocate memory than to allocate it?
Dec 9, 2009 at 7:11pm
Is it faster to reallocate memory than to allocate it?
It may be. Allocators rarely get exactly as much memory as you ask for, so sometimes it's possible to "resize" the allocated block by tinkering with its state, usually held a couple bytes before its start.
Dec 9, 2009 at 8:13pm
So this is the stuff that doesn't get taught. But doesn't new get rid of these issues? Like allocating the correct memory block etc.
Dec 9, 2009 at 8:18pm
Well technically I'm "taught" by a conglomerate of people on the internet and books. So obviously I'm going to miss things :)
Dec 9, 2009 at 8:41pm
But doesn't new get rid of these issues? Like allocating the correct memory block etc.
Uh... What?
Dec 9, 2009 at 11:24pm
IIRC, all new does different is call constructors. Maybe I don't know what I'm talking about...?
Dec 10, 2009 at 8:10pm
Well technically I'm "taught" by a conglomerate of people on the internet and books.


T.T I want books
Dec 10, 2009 at 8:36pm
Buy one then. K&R is good.
Dec 12, 2009 at 1:51am
I can't afford one T.T
Dec 12, 2009 at 8:39am
Google "Title_Of_The_Book_You_Cant_Afford pdf"
Dec 12, 2009 at 4:47pm
Really? What about viruses or other malware generally associated with anything free on the internet that is not open source?
Pages: 123... 6