I hate CS graders

Cogman

Lifer
Sep 19, 2000
10,286
145
106
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?
 

Safeway

Lifer
Jun 22, 2004
12,075
11
81
You needed to say how they work, probably. Allocate memory from stack, return memory to stack.
 

sdifox

No Lifer
Sep 30, 2005
100,331
17,913
126
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

I could not figure out your answer and I know what constructors and destructors do. So your answer is not complete.
 

pontifex

Lifer
Dec 5, 2000
43,804
46
91
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

i don't know anything about what you're talking about but that answer seems too short.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Originally posted by: sdifox
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

I could not figure out your answer and I know what constructors and destructors do. So your answer is not complete.

Ok, how would you define a constructor or destructor?
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
A constructor instantiates a new instance of a class. Destructors free up the memory used in the stack by that class.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Originally posted by: pontifex
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

i don't know anything about what you're talking about but that answer seems too short.

we where given about 2 square inches to write our answers, so my answer could have been about another sentence longer, max.
 

sdifox

No Lifer
Sep 30, 2005
100,331
17,913
126
Originally posted by: Cogman
Originally posted by: sdifox
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

I could not figure out your answer and I know what constructors and destructors do. So your answer is not complete.

Ok, how would you define a constructor or destructor?

I like homercles337's reply 3 above this post.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Well, just got a response from the teacher, basically I missed the first two because I didn't say that it was a member function and I didn't specify what they are typically used for (which you have all pointed out). But still, I missed full points for that? meh, whatever, its not like it is a huge portion of my grade.

Guess I'm just bitter because I get full credit on assignments because they work perfectly yet fail quizes because my definitions aren't complete enough, yet I clearly understand how to use them in assignment...
 

newb111

Diamond Member
Oct 8, 2003
6,991
1
81
Originally posted by: Cogman
Well, just got a response from the teacher, basically I missed the first two because I didn't say that it was a member function and I didn't specify what they are typically used for (which you have all pointed out). But still, I missed full points for that? meh, whatever, its not like it is a huge portion of my grade.

Guess I'm just bitter because I get full credit on assignments because they work perfectly yet fail quizes because my definitions aren't complete enough, yet I clearly understand how to use them in assignment...

You answered the question "When are constructors/destructors used?", not the question that was asked. I wouldn't have given points for it either.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Originally posted by: HardcoreRobot
you listed when you use them, not what function they perform

The function they preform is whatever function you tell them to preform. Constructors and Destructors are IMO best described by when you use them and not what they do (as they can do whatever the programmer tells them to do).

That aside, saying that they primarily are used for allocating memory is really what I missed in that question, however my definition IMO is not entirely off.
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Originally posted by: sdifox
Originally posted by: Cogman
Originally posted by: sdifox
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

I could not figure out your answer and I know what constructors and destructors do. So your answer is not complete.

Ok, how would you define a constructor or destructor?

I like homercles337's reply 3 above this post.

The question asks what they ARE, not what they (typically) DO. The OP answered the question properly; if the intention was to ask what they DO, the question was worded incorrectly.
 

AkumaX

Lifer
Apr 20, 2000
12,647
4
81
Originally posted by: homercles337
A constructor instantiates a new instance of a class. Destructors free up the memory used in the stack by that class.

+2 points for you
 

JS80

Lifer
Oct 24, 2005
26,271
7
81
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

BEWARE, you are being weeded out.
 

sdifox

No Lifer
Sep 30, 2005
100,331
17,913
126
Originally posted by: Cogman
Well, just got a response from the teacher, basically I missed the first two because I didn't say that it was a member function and I didn't specify what they are typically used for (which you have all pointed out). But still, I missed full points for that? meh, whatever, its not like it is a huge portion of my grade.

Guess I'm just bitter because I get full credit on assignments because they work perfectly yet fail quizes because my definitions aren't complete enough, yet I clearly understand how to use them in assignment...

It's better to know how they work than being good at writing tests. You'll do better in life than in school, which is not a bad thing at all.
 

StormRider

Diamond Member
Mar 12, 2000
8,324
2
0
Originally posted by: Cogman
My goodness, I think my CS grader is like some sort of nazi or something. There is no rhymn or reason to why he marks down different questions on a quiz.

For example, on of the questions was "(In c++) What are constructors/destructors"
My answer, "Functions called when objects are created/destroyed".

I completely missed it (they where 2 questions). What the heck? What is a constructor or destructor if not a function called when an object is created?

If I were your TA, I would have marked your answer as correct. That's basically what they are.

 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
btw, here is one that I missed one point on, I know the reason now, but lets see what you gurus think.

What is this? (in reference to the keyword used in c++ objects, this comment was not present on the test)

My answer "A pointer to the object currently being used".

Missed one point, can any of you guess why?
 

Safeway

Lifer
Jun 22, 2004
12,075
11
81
A pointer is a link to a specific memory location. Man, your answers suck.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Originally posted by: Safeway
A pointer is a link to a specific memory location. Man, your answers suck.

Do you understand what I meant by my answer? I think you do. And what you are pointing out is not why I missed the point. Try again?
 

steppinthrax

Diamond Member
Jul 17, 2006
3,990
6
81
In the fields of science and eng your knowledge about a subject is extreamly important. If you are missing any understanding in the subject later on you will have trouble. You will probably get away with that kind of answer in the liberal arts field but not in CS.


 

Safeway

Lifer
Jun 22, 2004
12,075
11
81
Originally posted by: Cogman
Originally posted by: Safeway
A pointer is a link to a specific memory location. Man, your answers suck.

Do you understand what I meant by my answer? I think you do. And what you are pointing out is not why I missed the point. Try again?

Because you used the word object?
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
Originally posted by: Cogman
btw, here is one that I missed one point on, I know the reason now, but lets see what you gurus think.

What is this? (in reference to the keyword used in c++ objects, this comment was not present on the test)

My answer "A pointer to the object currently being used".

Missed one point, can any of you guess why?

What was the exact question? A keyword is a predefined identifier. They can not be defined as program variables, or pointers. They can *be* pointers, but you cant define a pointer that has the same name as a keyword.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Nope, just a hint, what I said was correct, it is what I failed to say about "this" that I was marked down for.
 

Cogman

Lifer
Sep 19, 2000
10,286
145
106
Originally posted by: homercles337
Originally posted by: Cogman
btw, here is one that I missed one point on, I know the reason now, but lets see what you gurus think.

What is this? (in reference to the keyword used in c++ objects, this comment was not present on the test)

My answer "A pointer to the object currently being used".

Missed one point, can any of you guess why?

What was the exact question? A keyword is a predefined identifier. They can not be defined as program variables, or pointers. They can *be* pointers, but you cant define a pointer that has the same name as a keyword.

That was the exact question (minus the stuff in parenthesis).