PDA

View Full Version : C++ tests.



VirtualAce
06-21-2006, 10:59 PM
Why do I find programming in C++ much easier than taking tests concerning C++?

It's as if the test writer has to come up with the most ridiculous situation just to fool you because the answer to his question is actually quite simple.

I took some tests last night and did not score well, yet I consider myself advanced to expert level in C++.

Anyone else have this problem?

Not so sure I'd ever want to go to school for it - it would probably kill my enthusiasm. :)

I would like to get certified in C++ so I have some type of backing, but not so sure now. Just because I cannot answer some lame stupid question about an issue in code that would probably never arise, does not mean I cannot program.

And if I see one more class hierarchy like this:



class A
{
};

class B:public A
{
};

class C:public A, public B
{
};

class D:public C
{
};



I'm gonna scream. Who codes like this?

whiteflags
06-22-2006, 12:15 AM
Programming tests are evil, at least the ones online. Programming classes have better tests because they set you out to do a task and then you have to explain how your solution works. That's all that matters right?

cboard_member
06-22-2006, 01:58 AM
I have the same problem as you, Bubs. The same when someone asks me a question (especially on algo's) in class - it's like my mind goes blank. I prefer to write it than look at pseudocode or a description of a problem.

That class hierarchy is sick.

EDIT: Prefer as in I find it easier to understand / do.

hdragon
06-22-2006, 04:37 AM
Think about it, if ur expert in programming, usually you cannot answer some simple questions in the book. I had that same problem in the test (not that i'm an expertise in C++, but i'm alright). Sometimes, test questions just so stupid.

Sang-drax
06-22-2006, 06:45 AM
Why do I find programming in C++ much easier than taking tests concerning C++?
Because in normal programming you seldom use all the advanced features of C++ -- it is a very advanced language and it takes time to learn.

Prelude
06-22-2006, 08:49 AM
>Why do I find programming in C++ much easier than taking tests concerning C++?
Because tests cover a feature range that's much broader than the working knowledge of your average C++ programmer. And of course, test writers think they're being clever by giving you trick questions.

>Who codes like this?
That's a surprisingly common hierarchy, so common that it has an ambiguity problem named after it, but it's screwed up because the inheritance should probably be virtual.

Mario F.
06-22-2006, 09:19 AM
Truth is, most people don't really know how to write one. Few people outside US have had much exposure to american-style standardized tests. This is changing for a few years now, but regardless we have little knowledge of how to write these tests and, mainly, why it should be done so.

Among a few others, there is one fundamental truth about standardized tests that most people seem to forget. Answers must be evaluated objectively (the american-style subset of tests answers this perfectly). It matters little how one achieved the answer. What matters is if the correct answer was given.

Many test writers destroy this concept by inserting trick questions. If any, it should be trick answers that should be inserted in a standardized test. Not questions. As prelude said, they think it makes them look smart. But in fact, for anyone that knows what is the real purpose behind a standardized test, it makes them look rather dumb. For anyone else, it makes them annoying. It's a no-win situation.

Perspective
06-22-2006, 01:01 PM
>It matters little how one achieved the answer. What matters is if the correct answer was given.

huh? What matters most is how you achieve the answer......

If I give you a sort problem and you give me an exponential time algorithm that gives the correct answer... you certainly don't get the job, and you shouldn't get full marks for the test question. The solution is what matters, not the answer. Of course a correct solution produces a correct answer.

Mario F.
06-22-2006, 01:07 PM
That is not the purpose of a quizz or standardized test, Perspective.

laserlight
06-22-2006, 01:12 PM
If I give you a sort problem and you give me an exponential time algorithm that gives the correct answer... you certainly don't get the job, and you shouldn't get full marks for the test question. The solution is what matters, not the answer. Of course a correct solution produces a correct answer.
I think Mario F. intended that statement to apply to 'standardized tests', not interviews or general tests of the application of programming (related) knowledge and skill.

SlyMaelstrom
06-22-2006, 01:14 PM
Yes, it is. If you've ever taken a programming class in a University, then you'd see that they mark points off for poor efficiency. I could write the most obfuscated algorithm for the simplest problem and on any standardized test I've ever taken, I'd get bad marks on it. They do that because they know that same code would never get you a job. Even standardized tests, which multiple choice questions, I've received questions with multiple correct answers in which you have to choose the best.

Where I feel we're in disagreement is that you may be considering efficiency to be subjective, but it's really not. You could easily have dozens of working answers to a question and only one could logically be considered the correct answer.

laserlight
06-22-2006, 01:20 PM
I could write the most obfuscated algorithm for the simplest problem and on any standardized test I've ever taken, I'd get bad marks on it.
My impression is that these so-called 'standardized tests' usually have multiple choice questions, or at least very controlled answer possibilities.

IfYouSaySo
06-22-2006, 01:35 PM
Maybe you don't score as well on a test because it doesn't have a compile button, or a google search bar. I.e. you're limited by exactly what you know, and not what you know you can figure out given a compiler, a seach engine, and a little time.

SlyMaelstrom
06-22-2006, 01:41 PM
Maybe you don't score as well on a test because it doesn't have a compile button, or a google search bar.

Mmm... most tests keep you off the compiler intentionally because of that. It gets new programmers out of the habit of guess and check and leaves them to be able to run through the code themselves without the help of a compiler. ... and last I checked, most real tests are meant to be done without the help of a search bar. :p It's like my Pre-Calc teacher used to let us do... you can take the test with another student, but you have to split up your grade between the two of you.

Mario F.
06-22-2006, 01:52 PM
That is correct laserlight. I'm under the impression this is the kind of tests Bubba is referring too.

laserlight
06-23-2006, 12:11 AM
and last I checked, most real tests are meant to be done without the help of a search bar.
Well, there are 'open book' tests, though the definition of 'open' and 'book' is usually defined by the person administering the test.

SlyMaelstrom
06-23-2006, 12:20 AM
I personally haven't had an open book test since 8th grade. That's just my experience, though.

Not that syntax research isn't somewhat of a necessary skill in programming, it's just one that I haven't seen programming teachers emphasize.

twomers
06-23-2006, 03:18 AM
We had an open book test in some Applied Maths course in First year (college), but it was more of a continuous assessment test rather than the final majoy point scoring deal. Still it wasn't simple, I think the lecturer compensates for the openbookedness by making the tests harder.

C++ tests ... I don't know. I do alright in them, but that's more than likely because the C++ test we had this year was simple. If it was more advanced, I wouldn't know cause I haven't had one, but I still find the idea of doing a programming exam on paper kinda funny, but I do see the point someone brought up - it's for the purpose of pruning the not so goods.

CornedBee
06-23-2006, 09:27 AM
About half our tests in university are open-book. Of course, the book is so big that looking up all answers (or even most) takes longer than you have. And of course these tests require you to actually apply the gathered knowledge.

valis
06-23-2006, 03:04 PM
I find many of such standardized tests to be quite stupid. Just because person A knew the precedence and distributive properties of logical operators doesn't mean he is a better programmer than person B, because person B probably didn't focus on memorizing bull........ you can use () to sort out; instead B spent that time figuring out why & 1 is faster than % 2. One could even argue using parentheses is better than not, because those programming which don't have such properties memorized will know what the code is doing right away.

Mario F.
06-23-2006, 03:27 PM
I believe they are valid evaluation tools depending on the context in which they are applied.

I can see a standardized test being useful as a first filter for a job application, for instance. Or even a school test to evaluate specific knowledge that is more centered on language features (unfortunately the aim of many teachers) than programming techniques.

Of course, the so-called "Test your knowledge of C++" type of tests, are ludicrous. Not only because standardized tests cannot be seen as generic all-encompassing tools, but also because, as pointed out in the very beginning of this thread, most test authors don't really know how to create a standardized test.

IfYouSaySo
06-23-2006, 04:09 PM
My point about search engines etc. earlier was that you don't score well because you don't really "know" the material in the sense of having it completely memorized. And in the real world that is just fine, as long as you know how to find the answer in a reasonable amount of time.

SlyMaelstrom
06-23-2006, 05:47 PM
My point about search engines etc. earlier was that you don't score well because you don't really "know" the material in the sense of having it completely memorized. And in the real world that is just fine, as long as you know how to find the answer in a reasonable amount of time.
Mmm... that's true, somewhat. It really depends on the case. I'm sure in the case Bubba as well as others are speaking of, then it's a situation where it's highly acceptable to look up the info. In other cases, it might be something a programmer should either figure out logically or so basic that they should have memorized it.

I know that there was another programming teacher freshman year of college that gave open book tests for the Object Oriented C++ course. He would allow people to look at notes for syntax as simple as how to delete a dynamically allocated array. Something a C++ programmer would know off the top of their head. If he asked something like name all of the methods in ios_base, then I can clearly understand allowing them to look it up.

Sang-drax
06-24-2006, 04:26 PM
I find many of such standardized tests to be quite stupid. Just because person A knew the precedence and distributive properties of logical operators doesn't mean he is a better programmer than person B, because person B probably didn't focus on memorizing bull........ you can use () to sort out; instead B spent that time figuring out why & 1 is faster than % 2. One could even argue using parentheses is better than not, because those programming which don't have such properties memorized will know what the code is doing right away.
Those tests aren't stupid. You think they are programming tests, but they aren't. Their purpose is testing your knowledge of a language, not whether you know how to program. So, before you bash these tests you must ask yourself: what is their purpose?

Hunter2
06-25-2006, 03:04 PM
So far, I've had 2 programming courses. One was open-book, the other wasn't. I gotta say, the book (or a hastily scrawled parameter list on a corner of a napkin) *seriously* helps with the language aspect of any test. I know, to varying degrees, how to use most aspects of C++, and where/how to use them properly. However, for example, there's *no* way to remember function names and parameter order (and related named constants) for every function in the C++ library without either photographic memory or many years' experience (so far, 4-5 hasn't been enough). While I can usually remember what a function does, and what it requires, I can't always remember whether the FILE* is the first parameter, the source string comes before the destination, the result is returned through an argument, the return is 0 for success or error, etc.

valis
06-25-2006, 08:59 PM
Those tests aren't stupid. You think they are programming tests, but they aren't. Their purpose is testing your knowledge of a language, not whether you know how to program. So, before you bash these tests you must ask yourself: what is their purpose? I suppose the test isn't stupid with such perspective, however, syntax is trivial so I find it a silly thing to test people on. Once you know one simple imperitive language (C or pascal for instance), learning another is very easy, same thing with most other approaches (oop, functional, etc.). Also the core ideas across them all (recursion, loops, memory, etc.) is still the same.

Sang-drax
06-26-2006, 08:38 AM
however, syntax is trivial so I find it a silly thing to test people on.
Syntax is trivial in some languages, but if you ask me, C++ syntax can be very hard.

Mario F.
06-26-2006, 10:25 AM
however, syntax is trivial

C++ syntax is fundamental. As it is with any programming language. A programming language is only understood at the core by the understanding of its semantics and its syntax.

However, as Sang-drax said, the syntax on some languages is indeed trivial. Their language features imply an higher level of programming which in turn almost forces the language implementators to define a near natural-language syntax. Which they happily do.

This is not the case in C or C++. The syntax is rude and even offensive to someone migrating from an higher-level programming language. It is imperative one understands it. I believe there is no better example on the importance of the language syntax when one thinks of pointers. There is no seasoned C/C++ programmer that can't convince me he mastered the syntax so well, that he can now write complex address and dereference operations on objects without ever having to come back from a failed build. And lets not even get started on function pointers...

In fact, pointers syntax can be so confusing that this language feature is one of the few that offers an higher abstraction operator to contend with more complex operations. The -> operator. Correct me if I'm wrong, but in C++ there's only one other language feature that comes close to an higher level abstraction to deal with the complexity of the syntax. The typedef keyword. Many other programming languages offer a lot more than this.

But maybe more insidious is, exactly because C++ syntax shares very little aspects of a natural-language programming style, the fact that perfectly valid and apparently logical and correct syntaxes can lead to disaster. It is imperative the syntax is understood.


RegardlessOnce you know one simple imperitive language (C or pascal for instance), learning another is very easy, same thing with most other approaches (oop, functional, etc.). Also the core ideas across them all (recursion, loops, memory, etc.) is still the same.

And yet again I have to disagree :(
But this is an already long post. Maybe some other time ;)

laserlight
06-26-2006, 10:38 AM
There is no seasoned C/C++ programmer that can't convince me he mastered the syntax so well, that he can now write complex address and dereference operations on objects without ever having to come back from a failed build.
There is the possibility of typographical errors, though those would be easily corrected after a failed compilation. Actually, I think one reason why C++ has references is because too many levels of indirection can cause even seasoned programmers to make mistakes from time to time.

Hunter2
06-26-2006, 11:58 AM
>>There is the possibility of typographical errors, though those would be easily corrected after a failed compilation.
Ah, yes. Another reason why I tend to do better in real life than on written tests ;) You can't for example do this:

if(a < b)
{
}
and then fill in the body of the code after. Terrible, because my handwriting tends to distort from neat lines into slanted and oddly offset abstractions, and then I have trouble lining up my braces, which then leads to problems with triple-closing code blocks etc.. and, of course, sometimes it means I forget to close my braces, since I'm used to closing them immediately and filling the body in later.

VirtualAce
06-26-2006, 11:00 PM
Pointer syntax screws me up every time. I know what I want to do, but often I must compile to see if I used the correct syntax. I've gotten much better at it recently, but sometimes it takes a failed build and error message to assist me.

But this does not mean I cannot program in C/C++. I think it says a lot when you can interpret the cryptic error messages returned by the compiler and fix your issues on the next build or compile. Sometimes the hardest part about C/C++ is getting used to the insane compiler messages.

novacain
06-29-2006, 07:48 PM
I failed the last C++ test I was given at a job interview and did not get the job.

The next company hired me because I could find the answer I needed and had what they termed 'life experience'. They just wanted to see some of my code and find out if I would fit into their team.

Six months later I was assigned as a team leader because more people had been hired.

One of my team was the person who failed me in the C++ test.....

Keep plugging away Bubba. You are good at this, don't let the HR muppets convince you otherwise.


EDIT:
'life experience' == old bastard

Hunter2
06-29-2006, 08:35 PM
>>One of my team was the person who failed me in the C++ test.....
And I thought that only happened in movies... maybe the M&M dudes are real after all? :confused:

novacain
06-29-2006, 10:37 PM
>>maybe the M&M dudes are real after all?

who?

whiteflags
06-29-2006, 11:21 PM
Red and Yellow... I'm actually kind of sad that you don't know. Actually there are some new guys now but they aren't as important.
:o
Can I be a programmer and like candy at the same time? Or do I have to forget, and concentrate on programming?

Tonto
06-29-2006, 11:44 PM
Wait, the red guy failed the yellow guy or something? I thought they were friends.

whiteflags
06-29-2006, 11:54 PM
No, they have mascots for other colors too, Red and Yellow are still friends. :) That's what I meant. They don't matter as much because you don't see them in commercials as often.

novacain
06-30-2006, 03:01 AM
>>Red and Yellow... I'm actually kind of sad that you don't know.

Ahh.. the chocolate puppet thingies from the ads. Smarties are much better, but they are probably a local brand.

I avoid all commercial TV and any ads I can, we have two commercial free(ish) TV stations here I watch for news/docos.

I don't even know if the ads are shown on TV here, although they used to be.

Hunter2
06-30-2006, 06:51 AM
>>Smarties are much better, but they are probably a local brand.
Oi? I've seen 'em everywhere I've been so far. But I don't like the way their shells persist long after the chocolate's gone, it decreases my eating rate :o