What makes a good C/C++ programmer?

G

Gianni Mariani

Erik said:
There is no such thing. There are good C programmers, good C++
programmers and programmers who are good at both.

There is no such language as C/C++.

Actually, there is. Alot of my code 4-5 years ago was C but with a
little C++.

There are many "ways" you can use C++, one of them is the "C/C++" which
is the guy who is good at C trying to be a C++ programmer.
 
E

E. Robert Tisdale

Joseph said:
ERT,


Shouldn't we first discuss what makes someone a good human being,
before tackling more specific and complicated questions?

I don't know what makes someone a good human being.

All that I know is that
only the kindness and grace of the people who love them
can redeem them.
 
G

Gianni Mariani

Joseph said:
ERT,




Shouldn't we first discuss what makes someone a good human being,
before tackling more specific and complicated questions?

Anyone that writes good C++ must be a good human ?
 
A

Alan Krueger

E. Robert Tisdale said:
Alan said:
I've had to track down enough errors introduced by developers
who knew just enough C/C++ (particularly the latter) to be dangerous
that I don't buy this.
[...]
I don't know how you end up
tracking down errors introduced by "developers".
It seems to me that they should be tracking down their own errors.

If we could magically detect who introduced a bug before finding the
cause, I'm sure we'd assign it to that person up front. However, in
reality, you need to actually determine what's causing a software fault
before you can know how it got introduced, and who might have introduced it.

As an example of the "knows enough to be dangerous" label, consider
someone who has learned about C++ references, but not yet know that you
shouldn't receive a temporary automatic into a non-const reference.
 
A

Alf P. Steinbach

* Gianni Mariani:
There is alot more to it than that.

Such as?

The following "works":

template< typename T, T value_ >
class BitsSetIn_
{
private:
template< T n_ >
struct BitsSetInAux_
{
static T const value =
(n_ % 2) + BitsSetInAux_<n_ >> 1>::value;
};

template<>
struct BitsSetInAux_< 0 >
{
static T const value = 0;
};

public:
static T const value = BitsSetInAux_<value_>::value;
};

I fail to see the "lot more to it than that".


[snip]
I thought it was only std::endl that was not defined in ostream.

Presumably you mean "not defined in <iostream>", since what you write
doesn't make sense.

Assuming that: no, your perception was incorrect regarding the normative
text of the standard (the non-normative examples are defective).

Not quite - you only got 50% of the answer. You got the gimme answer.

What is the other 50%, and what is a "gimme" answer.

No. It's wether they can research it.


Describe why you think that is a problem.

Why I think _what_ is a problem?

If you mean, why is it impossible to say what could be wrong without
knowing the functionality of the things used, well, that could be the
exception to the rule that there are no stupid questions.

If you mean, why is it a problem to expose public data members and not
use constructors, I think you should ask that question in
[comp.programming], because it's a newbie design-level / general OOP
question not specifically related to C++. Or, consult the nearest good
introductory textbook. ;-)
 
C

CBFalconer

David said:
Yes, a CV that gives the applicant's C/C++ experience always looks
suspicious. It's as though the applicant believes that they are
interchangeable languages or that C experience can be passed off as
C++. They should always be treated separately.


Yes, but talented people don't need long to learn it. IMO, someone
who's memorized every nuance of C++ but can't solve the kinds of
problems they'll need to solve isn't going to be as productive
after a few weeks as someone who knows no C++ but is obviously a
talented programmer.

I see the c.l.c primary troll has managed to spark something by
crossposting to c.l.c++. The residents of c.l.c are generally
aware of Trollsdale and won't bite, but the c.l.c++ readers have
been trolled. Be aware that he 'edits' quotes. Sometimes he even
sounds knowledgeable. F'ups set.
 
G

Gianni Mariani

Alf said:
* Gianni Mariani: ....

I fail to see the "lot more to it than that".

Nice try. First, you understood that it was a meta-programming question
- many programmers would not. Second, the three most recent versions of
compilers I have don't like the code - which tells me either you didn't
try it or the three compilers I used are broken. If it's a case of not
trying your code, then, I am more interested in candidates that are more
rigorous. That's just the beginning, wait ... there's more.

MSVC 2k3 says:

bit_count_alf.cpp
bit_count_alf.cpp(10) : error C2065: 'value' : undeclared identifier
bit_count_alf.cpp(10) : see reference to class template
instantiation 'BitsSetIn_<T,value_>::BitsSetInAux_<n_>' being compiled
with
[
T=int,
value_=-2,
n_=-1
]
bit_count_alf.cpp(20) : see reference to class template
instantiation 'BitsSetIn_<T,value_>::BitsSetInAux_<n_>' being compiled
with
[
T=int,
value_=-2,
n_=-2
]
bit_count_alf.cpp(27) : see reference to class template
instantiation 'BitsSetIn_<T,value_>' being compiled
with
[
T=int,
value_=-2
]
bit_count_alf.cpp(10) : error C2056: illegal expression

http://www.comeaucomputing.com/tryitout/
says:

Comeau C/C++ 4.3.3 (Aug 6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing. All rights reserved.
MODE:strict errors C++

"ComeauTest.c", line 13: error: explicit specialization is not allowed
in the
current scope
template<>
^

"ComeauTest.c", line 10: error: constant value is not known
(n_ % 2) + BitsSetInAux_<n_ >> 1>::value;
^
detected during:
instantiation of class "BitsSetIn_<T,
value_>::BitsSetInAux_<n_>
[with T=int, value_=-2, n_=-1]" at line 10
instantiation of class "BitsSetIn_<T,
value_>::BitsSetInAux_<n_>
[with T=int, value_=-2, n_=-2]" at line 20
instantiation of class
"BitsSetIn_<T, value_> [with T=int, value_=-2]"
at line
27

2 errors detected in the compilation of "ComeauTest.c".

and GCC says

bit_count_alf.cpp:13: error: invalid explicit specialization before ‘>’
token
bit_count_alf.cpp:13: error: explicit specialization in non-namespace
scope ‘class BitsSetIn_<T, value_>’
bit_count_alf.cpp:13: error: enclosing class templates are not
explicitly specialized
bit_count_alf.cpp:14: error: template parameters not used in partial
specialization:
bit_count_alf.cpp:14: error: ‘T’
bit_count_alf.cpp:14: error: ‘value_’
bit_count_alf.cpp: In instantiation of ‘BitsSetIn_<int,
-0x000000002>::BitsSetInAux_<-0x000000001>’:
bit_count_alf.cpp:10: instantiated from ‘BitsSetIn_<int,
-0x000000002>::BitsSetInAux_<-0x000000002>’
bit_count_alf.cpp:20: instantiated from ‘BitsSetIn_<int, -0x000000002>’
bit_count_alf.cpp:27: instantiated from here
bit_count_alf.cpp:10: error: incomplete type ‘BitsSetIn_<int,
[snip]
I thought it was only std::endl that was not defined in ostream.


Presumably you mean "not defined in <iostream>", since what you write
doesn't make sense.

Assuming that: no, your perception was incorrect regarding the normative
text of the standard (the non-normative examples are defective).

<iostream> only gives 'extern' declarations for 'std::cout' etc.


Not quite - you only got 50% of the answer. You got the gimme answer.


What is the other 50%, and what is a "gimme" answer.

What happens after B's construction ?

A "gimme putt" in golf is an easy "tap in" putt.
Why I think _what_ is a problem?

There is somthing much more fundamentally wrong here. The generated
constructor (in this case) is perfectly fine. As to why we don't place
accessor functions around members. I think that's more of a religion
question and if you have somthing more than that to say, I'd like to
know, I don't mind being wrong...
If you mean, why is it impossible to say what could be wrong without
knowing the functionality of the things used, well, that could be the
exception to the rule that there are no stupid questions.

I know this is not a case where you're interested in the job, but I
suspect that a few minutes of research would yield your unknowns.
If you mean, why is it a problem to expose public data members and not
use constructors, I think you should ask that question in
[comp.programming], because it's a newbie design-level / general OOP
question not specifically related to C++. Or, consult the nearest good
introductory textbook. ;-)

Do you think that answer would get you the job ?

There is a constructor (2 in fact) that the compiler created for you.
Why do somthing that the compiler does better ?

The whole point is, the questions are just the opening point for
discussion. For example, I can tell you're not very interested in the job !
 
E

Erik de Castro Lopo

Gianni said:
Actually, there is. Alot of my code 4-5 years ago was C but with a
little C++.

Did that code compile with an ISO Standard C compiler? If not then it
was probably C++ but definitely not C.

Erik
 
C

Christian Bau

Mario Rosario said:
Are you a rookie or an expert C++ programmer?

Laughing,
Mario

You make the assumption that one starts as a rookie and progresses to be
an expert. Some people don't.
 
M

Mabden

Christian Bau said:
You make the assumption that one starts as a rookie and progresses to be
an expert. Some people don't.

You're wrong!

Everyone assumes that one starts as a rookie and progresses to be an
expert.

.... I assume.
 
G

Gernot Frisch

You're wrong!
Everyone assumes that one starts as a rookie and progresses to be an
expert.

... I assume.

I know of people that start as roookie and progress to troll...
 
M

Mabden

Gernot Frisch said:
I know of people that start as roookie and progress to troll...

<looks in mirror>
Nah! I'm an expert!
Your hypothesis is obviously limited.

...But everyone STILL assumes "that one starts as a rookie and progresses
to be an expert"!

It's an Axe'em. If they don't belief it you can axe 'em.
 
G

Gary Labowitz

This is correct, but look at the ads. The HR department writer of ads often
doesn't know what the difference is and may reject a resume that only says
C++. HR weeds out applicants and those that are technically correct may
never reach the stage of being called in for an interview.
The only good way of getting interviews is to know someone in the company
and getting an interview through networking, without going through HR.
My resume says "C/C++" and I have to say I know very little C. I think I
could pick it up if needed, but I never worked in it.
 
J

jacob navia

What kind of measurements have you undertook to justify such an absurdity?

You mean if I give a complex C program to sombedoy that
has just written an "hello world" program he will as
productive as an experienced programmer?

This is plain nonsense, not justified by anything else
but the sayings of Mr Tisdale.
 
A

Alf P. Steinbach

* Gianni Mariani:
Nice try. First, you understood that it was a meta-programming question
- many programmers would not. Second, the three most recent versions of
compilers I have don't like the code - which tells me either you didn't
try it or the three compilers I used are broken.

Worked fine with Visual C++ 7.1, at highest warning level. Anyway, as I
stated, _don't do that_. Templates were not made for arithmetic, much
less bitcounting.

If it's a case of not
trying your code, then, I am more interested in candidates that are more
rigorous.

I do not accept the label 'candidate', nor that the insinuation that I'm
not rigorous.

I don't, however, do a long research project to get something portable
for a usenet posting where I'm warning you that it's not likely to be
portable -- what the &/()=? would be the point of that?

Get a grip.

That's just the beginning, wait ... there's more.

MSVC 2k3 says:

That's _not_ MSVC 2003 (aka 7.1); not very rigorous of you...

[umpteen lines of compiler error message]

That's one reason why it's not a good idea, yes.

What happens after B's construction ?

That's impossible to know in detail without knowing at::Task, but
in general terms, at::Task::~Task is executed, and 'main' returns.

Do you mean that what's "wrong" is somehow buried in at::Task::~Task,
which isn't defined in the question?

That's an interview I'd walk out of very very quickly.


There is somthing much more fundamentally wrong here. The generated
constructor (in this case) is perfectly fine. As to why we don't place
accessor functions around members. I think that's more of a religion
question and if you have somthing more than that to say, I'd like to
know, I don't mind being wrong...

The generated constructor is not OK: it doesn't take arguments to set
up the state of the object.

Exposing public data members is something only the worst programmers do.

If you're interested in getting better than the very worst, don't show
that code in interviews -- or include the wrongness in your "answer".
 
G

Gary Labowitz

Not quite - you only got 50% of the answer. You got the gimme answer.


No. It's wether they can research it.

This is a tricky point. In that case, the fair way of asking the question is
"How would you research the following problem:" followed by the problem.
To ask a question (A) to determine an answer (B) which is "derived" from the
process is not only unfair, but can't be validated. Suppose the interviewee
answers the question. Did he research it? Did he research it "properly."
What is it you really want to know?

We will let it slide that these kinds of problem situations are exactly what
comes up all the time in the normal course of work (which I doubt, but it
could be) or a person not selected for interview who finds later that your
workers typically work on programs without such problems has a cause to
complain --- and could do so legally. These look like headaches waiting to
happen.

I'd love to see your "official" answers that are used to determine if the
interviewee gave a right or reasonable answer to them, which you could show
the court to prove that you actually had an "answer" that a reasonable man
would understand. I'm sure I would flunk this test, so I would like to see
the answers in order to learn something more about C/C++ programming (I
think these are just C++, however).
 
E

Efrat Regev

E. Robert Tisdale said:
What makes a good C/C++ programmer?

Would you be surprised if I told you that
it has almost nothing to do with your knowledge of C or C++?
There isn't much difference in productivity, for example,
between a C/C++ programmers with a few weeks of experience
and a C/C++ programmer with years of experience.

You don't really need to understand the subtle details
or use the obscure features of either language
to write useful programs in your application domain.
Expert C and C++ programmers
are only marginally more effective than rookies.
What really helps is understanding the problem domain
and experience solving problems in that domain with computers.

So what should employers look for when hiring C/C++ programmers?
Well, it probably doesn't help to ask them questions
about syntax errors that compiler diagnostics would catch.
Nor would it help to query them about subtle details
or obscure features. The best thing to do is to ask them
for examples of programs that they have written
or to write a simple program for your application domain.


What makes a good E. Robert Tisdale?

Would you be surprised if I told you that
it has to do with nothing concerned with your knowledge of C or C++?
There isn't much difference in productivity, for example,
between a newborn E. Robert Tisdale with a few weeks of experience
and an old E. Robert Tisdale with years of experience.

You don't really need to understand anything
or use anything
(except phrases like "useful programs in your application domain").
What really helps is understanding nothing
and experience solving nothing.

So what should employers look for when hiring E. Robert Tisdale?
Well, probably for their next job.
The best thing to do is to ask them
to please leave
 
E

Efrat Regev

jacob navia said:
What kind of measurements have you undertook to justify such an absurdity?

You mean if I give a complex C program to sombedoy that
has just written an "hello world" program he will as
productive as an experienced programmer?

This is plain nonsense, not justified by anything else
but the sayings of Mr Tisdale.

I think you missed my point. Possibly you might be interested in this link
http://www.ahsd25.k12.il.us/BasicSkills/kind.html#KLiteracy
 

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

Forum statistics

Threads
474,200
Messages
2,571,046
Members
47,646
Latest member
xayaci5906

Latest Threads

Top