google "top coder" contest = stacked against C++ coders

W

White Wolf

assaarpa said:
Yes, you can, but _that_ type must call the destructor where the
constructor was called. Factory design pattern is one solution, now the
only job left is to see that the destructor is invoked in the right
translation unit. A good way to do this is to to have DeleteThis(),
Release(), or similiar method and direct calls to destructor blocked,
these methods would then invoke "delete this;", where appropriate.

That tells a lot more about the design of DLL's in Windows than C++ or STL.
We are using dynamic load libraries and STL for over 5 years now on 3
opearting systems and several versions of them. We have never had trouble.
Of course if one works on a platform from a company, who always knows
better...

--
WW aka Attila
:::
A new study shows that licking the sweat off a frog can cure depression.
The down side is, the minute you stop licking, the frog gets depressed
again. - Jay Leno
 
A

assaarpa

We have never had trouble.

We never had trouble either: we know what we are doing, what's your point?
 
W

White Wolf

assaarpa said:
We never had trouble either: we know what we are doing, what's your
point?
First:
First, I acknowledge that the c++ does not know about dll's or Windows -
but
the Real World does! Use std containers to pass objects across dll
boundaries and you crash and burn so beautifully.
Then:
Can't you wrap it in a type that can pass accross the boundary safely?

Yes, you can, but that type must call the destructor where the constructor
was called. Factory ...

And my point was just what I have written. In a well design OS you do not
need all that. Why do you take this as an attack against you? Did you
design how DLLs work in Windows?
 
A

assaarpa

In a well design OS you do not need all that.

True, but not all very widely used OS are well designed. ;-)
Why do you take this as an attack against you?

Don't worry: I didn't, I appreciate your opinion and views but don't agree
some of the conclusions.
Did you design how DLLs work in Windows?

The point I am driving at is that it is well and good to know the C++ and
how it works and how things *should* behave, but those are just guidelines
which should be followed to have a shot at correctly behaving software.
Guidelines which are very, very important as not following them has dramatic
side effects like demons flying out of the nose.. but at end of the day, you
still have to know the platform and architechture you are compiling for,
there is no substitute for competence.

It is possible to write 100% conforming C++ sourcecode, which doesn't work
on a very widely deployed platform: Windows. If this is good or bad I don't
care to take a stance on, just stating the fact: nothing more nothing less.
I am not taking this personally, but facts are facts, sometimes the reality
just manages to elude some of the very optimistic people here. ;-)

It is different to write code that invokes undefined behaviour, and code
that doesn't but still doesn't work. The former is poor software engineering
and, well, so is the later -- but -- for the context of this NG, irrelevant,
thus, I admit that I been ranting about inconsequential off-topic platform
specific implementation detail (in otherwords, I'm wrong).
 
W

White Wolf

assaarpa said:
True, but not all very widely used OS are well designed. ;-)


Don't worry: I didn't, I appreciate your opinion and views but don't
agree some of the conclusions.


The point I am driving at is that it is well and good to know the C++ and
how it works and how things *should* behave, but those are just
guidelines which should be followed to have a shot at correctly behaving
software. Guidelines which are very, very important as not following
them has dramatic side effects like demons flying out of the nose.. but
at end of the day, you still have to know the platform and architechture
you are compiling for, there is no substitute for competence.

IOW: C++ does not define how dynamic linking OR multithreading works or does
not with C++. So there aren't even guidelines. Some companies choose to
make systems which makes it simple to work, some made systems where it is
harder.
It is possible to write 100% conforming C++ sourcecode, which doesn't
work on a very widely deployed platform: Windows.

??? As soon as you are using dynamic linking or MT it is NOT 100%
conforming code.
If this is good or bad
I don't care to take a stance on, just stating the fact: nothing more
nothing less. I am not taking this personally, but facts are facts,
sometimes the reality just manages to elude some of the very optimistic
people here. ;-)

But let's ask yourself honestly. If there are many OSes where it is easy to
do... is it a problem with C++ or is it a problem with Windows? And is it a
problem Microsoft tries to make into your problem instead of solving, or is
it primarily your problem to solve?
It is different to write code that invokes undefined behaviour, and code
that doesn't but still doesn't work. The former is poor software
engineering and, well, so is the later -- but -- for the context of this
NG, irrelevant, thus, I admit that I been ranting about inconsequential
off-topic platform specific implementation detail (in otherwords, I'm
wrong).

The trouble is, that as soon as you do dynamic linking or MT you are not
doing standard C++ and all bets are off. Then again: some companies made
those things easy on the people, some did not.
 
F

Francis Glassborow

assaarpa said:
It is possible to write 100% conforming C++ sourcecode, which doesn't work
on a very widely deployed platform: Windows.

Would you care to provide an example? Of course if you want to write
code that uses the full feature set of Windows there may be problems but
that would be a problem on almost any platform. I have yet to have a
problem with C++ source code producing a console app.
 
A

assaarpa

Would you care to provide an example? Of course if you want to write
code that uses the full feature set of Windows there may be problems but
that would be a problem on almost any platform. I have yet to have a
problem with C++ source code producing a console app.

Read the whole thread.
 
W

White Wolf

assaarpa said:
Read the whole thread.

He did read it, and not only that, but he has understood what I am trying to
communicate to you for quite some time now. If you use DLLs and/or threads
you are not using standard C++ anymore. And as I added: some platforms make
this nearly invisible, some not.
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top