Newbies don't learn C++

M

Miles Bader

Jorgen Grahn said:
Two patterns I dislike:
- Arguments between regulars who know the language. These too often go
quickly from arguments to an unwillingness to understand, to trench
warfare, and then into ad hominem attacks.

Totally agree with your post, especially the above point.

Most of the regulars here are smart and knowledgable (though of course
most have the odd blindspot or two), so the frequency with which they
fall into petty bickering at times seems almost surreal...

Has it ever really been any different though? This pattern is not
uncommon in technical newsgroups, and that's been the case as long as
I've been reading them.

-miles
 
J

James Kanze

If you want to define this term like that, so be it.

There's often a bit of arbitrary in technical definitions, so
you can't argue too much---Leigh (and apparently Microsoft, at
least in some documents) define leak in their own way. The fact
that the definition is practically useless, and doesn't relate
to the non-technical sense, make me shy away from it.

[...]
Instead, the IMHO important property of a resource leak is
that resources are allocated and not used any more but also
not released.

That too, doesn't seem to relate to the non-technical meaning of
leak. If a boot leaks, it's not that a little bit of water has
gotten in, it's that water is continually entering. If
a program leaks memory, it's not that a little bit of memory is
not being freed, it's that memory is continually not being
freed.

Note that this has nothing to do with reachability. Memory can
leak even if it is reachable (which is why you can have memory
leaks in Java). With regards to your definition: if such memory
is to be used later, then you have a problem: your program
requires infinite memory in order to run.

I'll admit that my point of view is prejudiced by having worked
on a lot of long running (years) critical and semicritical
applications. Obviously, if you're not going to stop the
program, you really don't care about static destruction:). On
the other hand, even a small "leak" (as I define it) will
eventually cause the program to run out of memory.

With regards to Leigh's point of view: I don't consider it
a leak, because it's a one of, and not something continual.
Ideally, I'd like to see a destructor for each constructor, but
from a practical point of view, if the cost of doing so is
a possible order of destruction problem, then it's not worth it.
Engineering is a practical activity, involving trade-offs. In
this case, I prefer a program which is sure to work over one
which meets some abstract ideal (but can fail during shutdown).

But of course, instead of discussing the technical merits of the
various solutions, some people prefer to engage in name calling.
 
G

gwowen

That too, doesn't seem to relate to the non-technical meaning of
leak.  If a boot leaks, it's not that a little bit of water has
gotten in, it's that water is continually entering.  If
a program leaks memory, it's not that a little bit of memory is
not being freed, it's that memory is continually not being
freed.

Yes, I'm certain that this is the time that you will convince Leigh,
despite all the evidence that he is not to be convinced, has no
interest in having his mind changed once its been made up. Let's make
one more appeal to the reasonableness and rationality on this score --
that's gone swimmingly well so far, hasn't it? Not once has
demonstrated complete indifference to the notion that other's peoples
opinions and definitions may also be valid, and he's never resorted to
name-calling - so I'm sure one last push is all that's needed to put
him over the top.

Definition of madness: doing the same thing over and over and
expecting different results.
 
M

Michael Doubez

It is not practically useless; it is perfectly acceptible definition of
what a leak actually is; you are confusing the causes of leaks with what
a leak actually is; an object becoming unreachable due to the last
pointer to it being "lost" can be a *cause* of leak and identifying such
causes is important (I never said otherwise).

I am not a native english speaker but if it is a one time operation,
it should be a drop (or a splash for big objects) rather than a leak.
Your leaking singleton is still a bag of shite.

Its real name is the Gamma Singleton IIRC.

IMHO still better than an over-engineered way of insuring correct
order of destruction or wrong usage upon exit.
 
M

Michael Doubez

It is still a bag of shite even if it does appear in GoF.  IMO GoF is in
error by omitting to mention when (or if) the singleton object is destroyed.

IMO rely on Java like feauture with GC. but in this case, it is the OS
that does th GC.
You are confusing the term "over-engineered" with the term
"correctly-engineered".  You are confusing the term "cowboy" with the
term "professional".  If you are able to design object construction in
an OO system you should be able to design object destruction in an OO
system; I do agree that this may be difficult in practice given the
existence of legacy systems and cowboy programmers.

I am talking about complexe systems that age other time or reach a
complexity where circular reference is not uncommon. Whatever your
professionalism, if you deliver a library that destroys its singleton,
you don't handle it but let the final user struggle with its order of
destruction issues.

It costs time, it costs help desk ressources, it brings defiance from
the customer or even worse delay or hard to locate bugs (since
multithreading can alter the order of initialisation/destruction issue
depending on the run).

And what do you have to justify that ? Nothing except a bunch of
principles and a definition on MSDN.

I remember windows 3.1 had problem with collecting memory (in
particular excell 2 would leave you with less memory at each run) and
I am not surprised that they pretend to defer the responsibility to
the programmer.
 
P

Paul

What has Java and GC got to do with C++ singletons? Java does not have
dtors.

Umm are you sure about that?
:p
Garbage; I use Meyers Singletons with no ill effects. Meyers Singleton
objects are destroyed in a deterministic fashion.


Garbage; I use Meyers Singletons in a multi-threaded system with no ill
effects. It is not impossible to ensure that the lifetime of a
singleton is greater than the lifetime of any threads that use it; I
have presented a thread-safe version of Meyers Singleton in this
newsgroup the other month.
Is there an echo in here?
:)

<snip...... snip>
 
J

Jorgen Grahn

Totally agree with your post, especially the above point.

Most of the regulars here are smart and knowledgable (though of course
most have the odd blindspot or two), so the frequency with which they
fall into petty bickering at times seems almost surreal...

Has it ever really been any different though? This pattern is not
uncommon in technical newsgroups, and that's been the case as long as
I've been reading them.

No technical newsgroup is 100% friendly, and c.l.c++ is not close to
being the worst one (comp.lang.c is worse, for example).

But yes, I think it has gotten worse here.

/Jorgen
 
Ö

Öö Tiib

I think what we have here is a group of people who are accustomed to
being the smartest in the room, whose knowledge and experience earns
them respect and deference from their coworkers. But here, they find
themselves among peers, and for some it may be a difficult adjustment
to make.

If you take a bunch of alpha dogs and put them in the room together,
there *will* be a lot of growling and snapping, as they sort out a new
pecking order among themselves.

Lot of regulars of any usenet group are also veterans of large flame-
wars of old. Usenet has been more than 2 decades. Now the newer, more
fancy, better organized forums and wikis attract new members better
and are taking over. Idiocy and spam in new communities gets down-
voted and deleted ... freedom of voice is gone. It is perhaps normal
that old warriors are now bit grumpy. ;)
 
A

Alf P. Steinbach /Usenet

* Öö Tiib, on 23.01.2011 14:08:
Lot of regulars of any usenet group are also veterans of large flame-
wars of old.

Right (at least, I've been involved in many a flame war, including really really
dirty ones involving legendary trolls such as Erik Naggum (RIP) -- he did on
several occasions suggest that people commit suicide, and did, for example,
describe my parents as alcoholics, so on, but very technically bright, nearly
always technically correct, and reportedly very nice person in private).

Usenet has been more than 2 decades. Now the newer, more
fancy, better organized forums and wikis attract new members better
and are taking over.
Right.


Idiocy and spam in new communities gets down-
voted and deleted ...

No, sorry. At least on StackOverflow herd-voting is quite common. It results in
incorrect answers often being designated as "the solution" to a question; lots
of dis-information being spread around.

And sometimes it results in the only correct answer being downvoted out of
existence.

It's just the tragedy of the commons.

I think it could be somewhat alleviated if these new sites supported real
discussions, as on Usenet.

But again, to take StackOverflow as example, all the zillion+1 requests to make
it less impossible to have structured discussions, have been denied, for the
reason that discussions are regarded as undesirable on the site.

freedom of voice is gone. It is perhaps normal
that old warriors are now bit grumpy. ;)

Yes. :)


Cheers,

- Alf
 
S

SG

[...]
Idiocy and spam in new communities gets down-
voted and deleted ...

No, sorry. At least on StackOverflow herd-voting is quite common. It results in
incorrect answers often being designated as "the solution" to a question; lots
of dis-information being spread around.

Aren't you exaggerating this a little? Disinformation eventually gets
downvoted in many cases from what I can tell. Users that know some
answer is wrong can comment and explain its flaws. So, eventually,
this is reflected in the votes.

Cheers!
SG
 
N

Nick Keighley

I was programming Windows COM Objects 10 years ago , and I'm not interested
in that anymore.Its old tech.

it wasn't that interesting when it new tech...
It appears to me that "the C++ community" has become very confused, since I
last visisted the world of C++.

10 years ago C++ was usefull because of the rapid growth of microsoft
windows,

there were other reasons
but thats old tech and its all been done.

all the programs that will ever be needed have already been written?
That's news to me.

Who cares about MS
windows as long as they can watch you-tube and blog with their mates.

you have arather narrow view of the world. There's a lot of stuff
still being written and MS Windows and Linux are popular platforms to
implement on. C++ will also run on embedded stuff (though C seems to
be more popular for the toaster). I bet a substantial amount of code
for handhelds is written in C++.

XBOX and IPOD is the current fashion, the latest thing being IPOD APPS. Java
is much more portable across the constantly changing hardware fashions that
is the world we live in today.

true. But well written C++ can often trounce Java in performance. Well
written C++ is also quite portable. I know size isn't as important as
it used to be but loading a JVM eats a lot ofmemory before you've even
written a line of code.

But really if don't like C++ or would rather program in something you
consider cooler, why are you posting to clc++? Or do you just like
the trolling?
WHy should anyone try to learn a programming language that is unneccessarily
overly complicated by unclear confused and undefined standards.

que? C++ is a large language and quite tricky to master. But it has a
well defined standard. To suggest otherwise is simply untrue.
C++ seems
caught up in a chiken-egg scenario with the C++ standard/s and they are
still arguing about the same shit they were 10 years ago.
like?


Some people refuse to accept the term object as it is widely used in
computer programming today.

In C++ a member function belongs to an object, end of story, there is no
argument about this its a FACT.

well I know you have a bee in your bonnet about this one. But honestly
does it really matter? Yes I call object.f() but f() is defined in
some class. The usually way to implement virtual methods is a pointer
to a table of functions. Only the pointer resides in the object.

In 10 years time C++ will be useless knowledge, as fortran or basic is
today.

I suspect Fortarn is alive and well and people are still writting
Visual Basic (I feel for them).

<snip>
 
N

Nick Keighley

When a member function is invoked for an object, the class is of no
relevance. A class is only necessary to create an object, after an object
has been created the class does not even need to exist. Only the function
definiton is required.

An object is bound to a member function dependant on the calling mechanism.
Whether it be a pointer within the object or an pointer in a register, or
whatever calling mechanism is used. The same cannot be said for a class.

A member function cannot be invoked if there is no object present,

unless it's a constructor or a static


<snip>
 
A

Alf P. Steinbach /Usenet

* SG, on 23.01.2011 16:30:
[...]
Idiocy and spam in new communities gets down-
voted and deleted ...

No, sorry. At least on StackOverflow herd-voting is quite common. It results in
incorrect answers often being designated as "the solution" to a question; lots
of dis-information being spread around.

Aren't you exaggerating this a little? Disinformation eventually gets
downvoted in many cases from what I can tell. Users that know some
answer is wrong can comment and explain its flaws. So, eventually,
this is reflected in the votes.

What's reflected by the votes seems often to just be pure herd-instinct.

It's the Schildt effect boosted by the absence of enough knowledgable folks to
counter it, by a lack of trust in reasoning by the participants (and indeed
often /inability/ to recognize valid and invalid reasoning as such), and by a
site actively designed to exclude reasoning (debate).

I would be dramatizing far beyond the available evidence if I described SO as
mostly a dynamic, evolving Schildt book, but it's certainly there.


Cheers,

- Alf
 
P

Paul

When a member function is invoked for an object, the class is of no
relevance. A class is only necessary to create an object, after an object
has been created the class does not even need to exist. Only the function
definiton is required.

An object is bound to a member function dependant on the calling
mechanism.
Whether it be a pointer within the object or an pointer in a register, or
whatever calling mechanism is used. The same cannot be said for a class.

A member function cannot be invoked if there is no object present,

unless it's a constructor or a static
.....................................................................

This is debateable for a constructor.
But in the case of a static yes obviously an object is not required.
 
P

Paul

I was programming Windows COM Objects 10 years ago , and I'm not
interested
in that anymore.Its old tech.

it wasn't that interesting when it new tech...
It appears to me that "the C++ community" has become very confused, since
I
last visisted the world of C++.

10 years ago C++ was usefull because of the rapid growth of microsoft
windows,

there were other reasons
but thats old tech and its all been done.

all the programs that will ever be needed have already been written?
That's news to me.

Who cares about MS
windows as long as they can watch you-tube and blog with their mates.

you have arather narrow view of the world. There's a lot of stuff
still being written and MS Windows and Linux are popular platforms to
implement on. C++ will also run on embedded stuff (though C seems to
be more popular for the toaster). I bet a substantial amount of code
for handhelds is written in C++.

XBOX and IPOD is the current fashion, the latest thing being IPOD APPS.
Java
is much more portable across the constantly changing hardware fashions
that
is the world we live in today.

true. But well written C++ can often trounce Java in performance. Well
written C++ is also quite portable. I know size isn't as important as
it used to be but loading a JVM eats a lot ofmemory before you've even
written a line of code.

But really if don't like C++ or would rather program in something you
consider cooler, why are you posting to clc++? Or do you just like
the trolling?
WHy should anyone try to learn a programming language that is
unneccessarily
overly complicated by unclear confused and undefined standards.

que? C++ is a large language and quite tricky to master. But it has a
well defined standard. To suggest otherwise is simply untrue.
C++ seems
caught up in a chiken-egg scenario with the C++ standard/s and they are
still arguing about the same shit they were 10 years ago.
like?


Some people refuse to accept the term object as it is widely used in
computer programming today.

In C++ a member function belongs to an object, end of story, there is no
argument about this its a FACT.

well I know you have a bee in your bonnet about this one. But honestly
does it really matter? Yes I call object.f() but f() is defined in
some class. The usually way to implement virtual methods is a pointer
to a table of functions. Only the pointer resides in the object.

In 10 years time C++ will be useless knowledge, as fortran or basic is
today.

I suspect Fortarn is alive and well and people are still writting
Visual Basic (I feel for them).

.......................................................................................

Thats how I feel for C++'ers now.
I once considered myself a C++'er but I feel a massive weight lifted now
that I've chosen to dump it.
:)

GL.
 
R

Rui Maciel

SG said:
Aren't you exaggerating this a little? Disinformation eventually gets
downvoted in many cases from what I can tell. Users that know some
answer is wrong can comment and explain its flaws. So, eventually,
this is reflected in the votes.

That isn't necessarily a given. Votes matter when the main objective is
to manage the approval of an entire group of people regarding subjective
issues. This is why it's possible for disinformed and ignorant people to
cast their vote and have it accounted for with the same importance as
those votes set by more informed and knowledgeable people. So, there is
no guarantee that such a voting system will value correct and unpopular
information over any entry which is incorrect but managed to be popular.

There are also other nasty consequence that are caused by this reliance on
a voting system to filter out the crap. A couple of them are: popularity
contests and the lack of critical thinking.

The first one is a sort of reiteration of what I've mentioned previously:
ignorant people can vote on a suggestion, no matter how wrong it is. As
we see frequently, this forces some users to simply cast their vote not
because they understand how they are voting but because they perceive that
option to be the right one, even though they remain clueless. One thing
that may lead ignorant users to mindlessly vote on an entry is their
perception of what opinion is currently popular. As a consequence, we
will have users who vote on something basically because other people voted
for it. As a result we get a self-validating feedback loop that causes
the worth of a particular suggestion to be valued not because it is valid
but because "everyone says so".

The second one is much more damaging. The previous example demonstrated
that the reliance on popular votes to state what is right and what is
wrong is worthless as a system to arrive at the "truth". The reliance on
a vote count by someone to be able to acknowledge that a particular piece
of information is valid or not essentially means that that person is
unable to analyse the information which is made available to him and, from
there, infer his way to a conclusion. In short, those who rely on vote
counts don't think their things through and tend to blindly follow what
others tell them.

So, just from these examples alone, it is easy to see that relying on a
voting system to weed out right from wrong is, in fact, a very serious
disservice that people do to themselves. No one wins from that, except
the site operators who go on cashing on the traffic they manage to
generate.


Rui Maciel
 
S

stan

Paul said:
......................................................................................

Thats how I feel for C++'ers now.
I once considered myself a C++'er but I feel a massive weight lifted now
that I've chosen to dump it.

Just a thought but maybe your problem isn't with c++ or other c++
developers but is in fact usenet. Maybe this just isn't your kind of place.
 
P

Paul

stan said:
Just a thought but maybe your problem isn't with c++ or other c++
developers but is in fact usenet. Maybe this just isn't your kind of
place.

If you think a bunch of uneducated teenagers in a newsgroup constitute a
problem to me then think again.
 
O

osmium

Francis Glassborow said:
I simply cannot understand why you keep posting here. You apparently do
not like C++ and do not like the people so what is your point in hanging
around?

I simply cannot understand why you can't figure it out! He has found a home
here with several people willing to respond to his drivel. Scan through the
huge number of posts he has received in this thread alone. Then ask
yourself how rewarding it would be to stand on a desert island and shout
hour after hour, day after day with no response. Paul has been at it a month
or so and has had great success in getting responses. Perhaps he is going
for some trollmeister all time great award.
 
R

Rui Maciel

stan said:
Just a thought but maybe your problem isn't with c++ or other c++
developers but is in fact usenet. Maybe this just isn't your kind of
place.

Trolling is one of Usenet's traits. Therefore, his insistence in posting
stuff shouldn't surprise anyone.


Rui Maciel
 

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
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top