We can use it for the heads-up display for our flying cars (just a few years away) powered by practical fusion (just a few years away) while traveling to the clinic for our immortality tratements (just a few years away)
...using an automated AI flying system (just a few years away), spending our time on the car playing Duke Nukem Forever (just a few years away)...
A big lawsuit against the UK government, most probable carried to the EU level, not only will result in a big compensation (for psychological damages), but also make agencies to be more careful.
The problem is that current programming languages don't use a programming paradigm like the Actor model, which makes every object a separate thread. If such was the case, each new core would increase parallelism, as permitted by the underlying algorithm.
Welching on our obligations to foreign countries isn't going to help anything. In particular, our protection of Japan and South Korea has done more to keep East Asia peaceful than anything else
It should be the UN's obligation, not the United States'. You understand that if it's something decided globally, then it would be much more acceptable, do you?
With due respect, I think we already do these things.
With due respect:
you took Kosovo out of Serbia. It's like taking New York out of the US.
you allowed culture stealing in the case of 'Macedonia'.
Cyprus has been invaded in 1974 by Turkey, yet you are doing nothing about that.
You supported various Juntas around the world.
You wanted the Palestinians to be more democratic, i.e. to vote for their leaders, but when the elected leaders were the ones you did not expect, you spoke against them (double standards).
No thanks. As corrupt as the American government can get, it doesn't match the corruption of the UN; leaving our government under the jurisdiction of a corrupt foreign entity is a bad deal and we're shocked that other countries do it.
The UN is not corrupted. That's what your media wants you to accept. Some of the people of the UN are corrupted, but Bush is way way way more corrupted, let's not forget that. The UN is very important for peace on Earth, and USA does anything they can to undermine it.
Recent history aside, we've always done this in our own way.
Charity is not welfare. Tent cities outside Los Angeles anyone?
When's the last time we've interfered with a South American country, aside from our anti-drug efforts?
You are currently interfering with Chavez' government in Venezuela: you want him to be removed from power, and you (well, not you, it's not your fault, it's your government's fault, that you unfortunately voted for, without knowing what is gonna happen) do anything you can to achieve it.
Yes, I'm sure lots of folks around the world would like that. Should we disband the military and send you all nice invitations to send your troops to Washington?
You don't need all that guns. Who is going to invade Washington? no one. So let's stop talking fantasies for a minute...
We're doing this and it needs to stop.
You are not doing this in any degree that's effective, because drugs is a valuable way of controlling the population and foreign affairs. For example, you are not burning the opium fields in Afghanistan, where most of the world's drugs come from, even though the highest number of AWACS aircraft patrol the area, and most US satellites are pointed towards the area as well. Opium production has increased 70% after you invaded Afghanistan.
I agree with you, but the concept of a military organization that only some countries can be part of automatically makes other countries which are not part of it to be enemies. It would be much better if there was a global army sponsored by the UN, for the same reason as NATO.
To put it differently: many people see NATO as the imperial army of the United States. Not good, if you ask me.
I'm sorry, I thought we were talking about the United States. What country do you live in?
I am not gonna say, because I don't want the discussion to have bias.
Because legalized theft is still theft. There's nothing moral or proper about taking money from the rich just because they happen to have more.
Taxation is not theft. That's the weirdest thing I've heard regarding taxation. Taxes are a form of payment towards society: it pays people to make schools, roads, hospitals, water networks and other infrastructure necessary for today's organized societies.
Anything that the rich spend or invest their money does more to help the economy than stealing it from them to give to the poor. There is no stimulus to the economy in a transfer of wealth.
Nope, your economics are way way way wrong. I understand you though: you are brainwashed, just like most of Americans are. When a rich person buys something, the money does not help the economy, because most of what he pays goes to similarly rich people, the ones that own the means of production of said product.
Not at all. I believed the same thing years ago when I was earning minimum wage at McDonald's. The problem is people like you who are blinded by idealism to the fact that liberal economic policies cannot and do not work.
It's not idealism. It's reality: those who have more must offer more. The media has made you believe that liberal economic policies do not work, because the media are owned by the same class of people that owns the means of production. Look at countries like Switcherland or Sweden: very high taxation, but much higher standard of living than USA, and excellent social welfare. It's not like USA that when you loose your job, you can't go to the doctor.
I'm guessing you aren't a Christian because you clearly don't know what you're talking about, so don't even try to use scripture to backup failed economic policy
Actually, I am an Orthodox Christian and I can read the Bible from the prototype. You can't. And I've done so, therefore I am entitled to use scripture If I want. And what I said is true: your are false Christians, because money is your real God (well, that's true in my country as well), but you worship someone that was, in essence, a communist!!!
I am 100% in favor of helping the poor. I just think that's my responsibility and my church's responsibility. Not the Federal Government's through mandatory wealth redistribution.
Welfare in the form of charity is the biggest joke this side of Keynes-ian economics! modern capitalism has made people believe, through propaganda spread by media, that charity is the only acceptable means of helping the less fortunate. This is, of course, a trap setup by the central government (in any country, it's almost the same now), that is directed by those rich guys that control the media and the means of production, in order to be able to control how much welfare is given to the poor. In times of economic crisis, the charity system allows the rich people to take away welfare and save themselves from becoming less rich...on the other hand, an organized social welfare system requires a steady flow of money towards it, something that the rich people don't like.
Actually, it would take about 6 months/1 year to regain the former image, in doing the following:
1) remove armies from around the world; restrict your armies for your defense only. 2) dismantle NATO. 3) work in the context of the UN organization. 4) study history and support the right view historically (in cases of Israel vs Palestinians, Turkey vs Cyprus, Tibet vs China, Greece vs Macedonia etc). 5) stop interfering with countries of the former Soviet Block. 6) dismantle Guantanamo. 7) recognize the International Court of Justice. 8) sign the Kyoto agreement and act on the environmental issues. 9) improve social welfare. 10) stop interfering with South America countries. 11) minimize weapon production. 12) start a military campaign against drugs; burn all the drug-producing fields around the world (the ones that your satellites know about).
If you did only half of the above, your image would improve in a minute.
Easy: people that don't have a job are terrorists. People that don't want to enlist to the armed forces are terrorists. People that do not want to see "progress" like cutting down forests and building malls are terrorists. The list is endless, really.
The rich are the only people that pay any significant amount of taxes.
No. In my country, the rich pay up to 25%, the poor pay up to 40%. That's unfairness against the poor, instituted by the rich people that control the means of production.
It's impossible to decrease taxes on someone that doesn't pay them. For example, if you wanted to give $200 billion in tax cuts, you'd have to give most of that to the rich because the "poor" paid much less than $30 billion in taxes in 2004 so, by definition, at least $170 billion would have to go to higher income citizens. That doesn't mean a tax cut is a bad idea, it just means a tax cut will be of direct benefit only to those who are paying taxes.
The point is, why cut taxes? the rich people are not going to invest that money in things that will help the economy. Tax cut is indeed a bad idea, especially in countries like USA that social welfare goes down the drain.
That's a philosophical/political opinion, not a statement of fact--and many, myself included, would disagree with you.
Those who disagree, including you, are most probably blinded by the power and luxuries money can buy. For a society that declares that 96% of them are born-again Christians, you are certainly hypocrites, because Jesus said that "it's easier for a camel to pass through the eye of a needle than a rich man to go to heaven". So from one hand you pray to someone that blasted the rich, and from the other side you want to be rich.
The correct and fair thing to do is that rich people should pay more than poor people. And not only that, but the more rich you are, the more taxes you should pay.
But decreasing taxes also does not help the economy, if the decrement is on the taxes that rich people pay. Tax decrement must be uniform on all classes of society, and of course proportional to the income of each person: the rich people should pay more, the poor people should pay less.
I'll go one further: Anybody that supports the war should volunteer to participate in it.
I'll bet you that all those war supporters that happily cheer "go America" as they see the troops from their comfy living room will suddenly change their minds about this bloody war if they have to do it themselves...
You don't even need colors to detect cycles; all you need is a flag.
But I was talking about cycle detection at compile time, i.e. statically.
Even if cycles can be detected at run-time, it's still not as good as a solution as garbage collection, because if cycles are detected only in debug mode, then it means testing should have 100% coverage, which is something impossible in practice.
And doing it in C++ is very difficult, because it needs support from the compiler.
But the changes are transparent to the user of the language, and that's what counts.
That's the problem. Resource Allocation as Initialization and garbage collection do not play well together. Do you want to wait until the next GC before a window closes?
Actually, they do. I would not have to wait for a window to close until the next GC if a locally allocated object closes the window automatically in its destructor. RAII is one of the best concepts ever.
Page level write protection/dirty page bit hardware, or periodic freezes. Pick one.
Embedded systems should have their own C++. C++ is not a systems programming language, as it is erroneously being put forward. All major apps are build with C++ (and they suffer from the same problems). So, to answer your question, since all systems now have page level write protection hardware, there is simply no problem with me.
Even if a garbage-collected C++ was used in an embedded environment, manual memory management could be emulated by the use of custom allocators.
And that's the problem. There are some subtle no-nos in destructors called from garbage collectors.
You exaggerate. The problem is minimal, actually, and it mostly involves thread synchronization primitives. No major frameworks exist (that I know of) that have objects that they lock/unlock critical sections in their destructors. I've read such cases in custom code though. Well, destructors should not lock things, and if GC ever comes in C++, this code should have to be changed. Other than that, there are no problems with destructors whatsoever.
I'm arguing for a debug mode in which cycles are detected at the moment of creation. Cycles are typically a design time problem; if a program generates cycles, it will probably generate cycles on every execution. This tells you when you need weak pointers.
So you prefer an extraordinary solution, highly improbable of being implemented, one that needs support from 3rd party tools, to the simple solution of garbage collection??? I am amazed. Furthermore, the general case of recognizing cycles is an unsolvable problem, thanks to the halting problem. If it was a solvable problem, it would have already been solved at run-time.
If your data structure is anything like a tree, the cycle problem can usually be fixed by making pointers towards the root weak. I did this last year for Python's BeautifulSoup HTML/XML parser, which generated trees with pointers both backwards and sideways. By making pointers towards the root and towards previous elements "weak", I made the trees loop-free. Now they go away when the root element does, and parts can be cut out of the tree without creating loop problems.
That's a trivial case. What about the case I described to you? programmer A writes a subclass Y of class X with a pointer to object C produced by a factory F (and F keeps a pointer of the new instance). Then another programmer B goes and changes the factory F to keep a pointer to X...and this happens not only by another programmer, but after a year programmer A did the original interface. You now have a cycle (X->Y->C->F->X) which is undetectable until performance is hurt and people notice it.
Move semantics are enabled by rvalue references (i.e., references that bind to rvalues, as opposed to the existing references in C++ '98 that bind to lvalues).
I never said otherwise.
Rvalue references and move semantics solve a performance problem, not a memory management problem.
I never said that they don't. I know and understand very well how and what rvalue references and move semantics solve. You don't seem to understand how problematic move semantics are.
By pilfering the resources of an object that's guaranteed to exist only until the end of the full-expression in which it's created, you can avoid successive calls to expensive allocators of resources (like heap memory).
Allocation/freeing is expensive because garbage collection is not used.
First, note that you do not get move semantics without rvalue references. And move semantics are meant to apply only to rvalues (not lvalues -- although you can explicitly force an lvalue-to-rvalue conversion and then do a move, but generally there is no need to).
Nothing is saved by that. If you examine the examples given by Stroustrup himself (for example, on artima.com), you'll see the exact same problems that plagued auto_ptr. I guarantee you a massive outcry against move semantics by most C++ programmers.
Second, the performance gained from compiling existing C++ programs against rvalue-ref-enabled libraries is quite measurable, and in many cases the speed gains are close to a factor of ten over the version of the same library without move semantics.
But that's only because (in current STL), heap data are not shared! Your logic is circular: "new STL with move semantics is way faster than the old STL because of data moved around". Well, if there was garbage collection, your data could be moved around without any problem, wouldn't they?
Third, when the committee accepted the proposal for rvalue references, *nobody* claimed that it would be used as a substitute for garbage collection.
I don't understand why you keep telling me that rvalue references are connected with garbage collection. I never said that. All I am saying is that move semantics is bad, and if gc existed, there would be no issue to solve.
If and when Garbage Collection is accepted, you can look forward to programs that use *both* rvalue references *and* GC (and with good reasons for using both).
If GC is accepted, then move semantics will not be required, and hence rvalue references will not be of much use, since value copying would be pointer copying.
On the other hand, if GC ultimately does not make it into C++0x, you should be aware that
(a) it will not have been the fault of proponents of ravlue references (who are also mostly proponents of GC) and
I don't believe that the C++ committee really likes garbage collection. It's obvious, from their replies in the various forums. They believe in manual memory management, no matter what everyone else (provably) says.
(b) work toward GC will continue so that it can be adopted into the following C++ (probably C++13).
Yeah, there are two things I'd like to see before I get too old to be a programmer: a) Duke Nukem Forever and b) C++ with garbage collection!!!
Let's not kid ourselves, it will not happen.
Fourth: the committee has not rejected garbage collection.
This kind of double speak is meaningless to me: until I see GC in the language, it is in a rejected state. What I care about is for my programs to work without a problem, I don't give a dime about the C++ committee.
Programmer-controlled GC (i.e., GC that can be explicitly disabled or explicitly enabled)
Although you start off on the right track, you make some mistakes on the way. Let me please point them out for you.
It introduces a sort of concurrency into otherwise sequential programs, leading to timing jitter (at least), stalls (maybe), and nonrepeatable bugs.
Not at all. IBM even has a real time Java (hard real time).
Garbage collection and destructors do not play well together. See "Managed C++".
No, that's not true either. C++ has RAII, so the point is not valid.
Concurrent garbage collection requires some support from the memory management unit and operating system, so the hardware can detect "dirty pages"
No, it does not. All that's required is CAS operations.
Calling destructors from another thread in the garbage collector can introduce race conditions or deadlocks.
It depends on what your destructor is doing. Under GC in C++, resource management would be managed with RAII, so there is no problem with deadlocks and stuff.
Conservative garbage collection can result in memory leaks, and offers a new avenue for denial of service attacks if someone can send you buffers full of carefully constructed junk.
Agreed, GC needs to be integrated with the language.
Garbage collection is fine for programs at a somewhat higher level, like Java, but you probably don't want it inside your operating system kernel or media player.
You mix two totally unrelated domains. A OS kernel can have GC, but usually it is too low level to have one. On the other hand, a media player can have GC, since a media player does not constantly allocate and deallocate memory blocks.
In Java, programmers worry about garbage collection and finalizers.
They don't, in 99% of the cases. I belong to a group of programmers that make Java applications (as well as C++ apps) and that Java programmers worry about GC is all but a myth. It's only when there are libraries that are not well thought out that GC is a factor.
But in Perl and Python, which are reference counted, programmers seem to mostly ignore memory management without problems. With reference counts, destruction is deterministic.
That's because their stuff does not contain cyclic references.
(C++ reference count template packages tend to leak raw pointers, leading to bugs)
Not if the reference count is embedded into objects.
The answer to cycles may be to provide weak pointers, then simply prohibit cycles, with a debug tool to catch them. If you need some complex structure with heavy interlinking, like a window manager, make all the window objects owned by some collection, then make all the inter-widget links weak.
Don't underestimate the power of cycles! cycles can be introduced indirectly, through inheritance, and then it's very very difficult to track them...trust me, I've been hunting a memory leak introduced by a subclass which obtained a shared ptr from a factory interface, only to discover that the the base class was already already referenced somewhere from the object returned by the factory; the cycle was not obvious, until the program accumulated lots of craft after a long operation.
The "move semantics" mess arises from the fact that parameter passing in C++ is an assignment, invoking the "=" operator. This leads to a temptation to redefine the "=" operator. If you have reference counts, though, you don't have this problem.
In my opinion, move semantics arises from the fact that Stroustrup thinks complex data structures can have value semantics.
The C++ standards committee can not agree on a GUI model, that's why they abandoned it (the excuse was that half of the people wanted a Model-View-Controller framework, the other half a simple callback-driven framework).
Furthermore, according to them, who needs a GUI library for C++? no one. C++ is a systems programming language, get it? (despite the fact that it's not used anywhere as a systems programming language)...
Totally agreed, and not only Stroustrup, but also the other members of the C++ standards committee.
Their latest monstrosity is move semantics, i.e. data allocated on the heap are moved around and freed by the last object that has their ownership. Move semantics work just like auto_ptr, i.e. a newly constructed object gets the ownership of the data...this guarantees disaster, because in a complex expression/statement block you will not be able to tell which destructor really destroyed the data...
And all this because they deny to fix the language and put garbage collection in! with GC, move semantics would not be required, as the shared data structures would be deleted only when not referenced by any code. And their excuse for not putting garbage collection in C++ is just as lame: "some people will react against it!" even if GC is totally optional!!!
You want a list of C++ applications that have crashed on me one time or another? here it is:
U-torrent, Deluge, Firefox, Internet Explorer, Windows Explorer, Microsoft Word, Microsoft Visual Studio 6, a lot of games, MAME32, and many others!
On the other hand, I can't remember a Java app that regularly crashed on me now or in the past.
The only reason for this situation is that C++ is a horrible mess of a programming language! Stroustrup's denial has cost million of dollars in the industry, and quite a few thousands in my company from bugs resulting from the horrible C++ mess...
But garbage collection is faster than manual memory management, especially for computationally complex problems: the least you want is to pay the price for the allocation/free algorithms while your computation needs all the available cycles!
I don't know why you where modded insightful, but your comment is totally wrong, just like Stroustrup is.
First of all, the new move semantics bolted onto the new C++ will be a complete disaster for most programmers, just like auto_ptr was. The only reason move semantics exist is because there is no garbage collection.
Secondly, garbage collection is FASTER (repeat, FASTER) than manual memory management! If you have ever done any tests, Java blows C++ out of the water in memory management tests.
Thirdly, the problem of horrible bugs and completely incomprehensible code is due to C++'s complexity, which is the result of bad language design, and the lack of garbage collection, in particular.
Since you are doing computationally intensive complex problems (I suspect of mathematical nature, isn't it so?), you might want to try Haskell. You'll be surprised on how easy it is, since it's actually executable math.
It depends on the type of women you want to approach. My comment was about long term relationships which are based on mutual trust...a relationship that may lead to a family.
Personally, I find these relationships more satisfying than short intense erotic relationships. There is much enjoyment to be had from hand holding as well as from making love.
If you want to attract the more adventurous women, you can try to play the really daring type, the playboy, the guy with the Harley Davidson which is an easy rider, but would it be really you? women can easily understand pretenders. I prefer that women like me for what I am, even if what I am is not very exciting or adventurous...
Not the programming language, of course! Smalltalk with a girl you like, and if she really likes you, the conversation will go on without any embarrassing pauses. Smalltalk allows us to relax and let ourselves be, and any underlying feelings usually surface.
There are some subtle clues to as if a girl likes you; for example, if, after a long conversation, she starts to touch you. Or if she turns her body towards you while she speaks.
Of course none of the above guarantee 100% that a girl likes you. But it's a good start.
Remember some general principles: be clean, be gentle and polite, show interest in your partner, be sincere.
Also remember that one of the most important feelings for women is the feeling of security: try to make them feel relatively secure; women have a wide spectrum of feelings but they are usually reluctant to show them until they feel nice and welcomed to the person they speak to.
Finally, also remember that for women, sex is more a psychological operation than a physical one. Sex is not the same for the two sexes. Women are mentally and emotionally aroused before physically aroused, so try to care for them!!!
You are right, and I've been telling this for quite a while (for example, my most recent post here).
I have also suggested this in other sites (example: LtU), but the response was "oh no!" and "disaster!"
For me, it's clear that the so called 'standards' for development of web applications are of very low quality: badly thought out, inefficient, without any concern on security. Perhaps if more people recognized this, the community would be pushed to create something better...
The operating system does not need to have a well-featured photo organizer, a media player with built-in internet radio browser, music store, cd burning, skinning, visuals and so on.
If it's so, then how come Linux distros come bundled with everything but the kitchen sink?
It can be done via the Actor model.
A big lawsuit against the UK government, most probable carried to the EU level, not only will result in a big compensation (for psychological damages), but also make agencies to be more careful.
The problem is that current programming languages don't use a programming paradigm like the Actor model, which makes every object a separate thread. If such was the case, each new core would increase parallelism, as permitted by the underlying algorithm.
- you took Kosovo out of Serbia. It's like taking New York out of the US.
- you allowed culture stealing in the case of 'Macedonia'.
- Cyprus has been invaded in 1974 by Turkey, yet you are doing nothing about that.
- You supported various Juntas around the world.
- You wanted the Palestinians to be more democratic, i.e. to vote for their leaders, but when the elected leaders were the ones you did not expect, you spoke against them (double standards).
The UN is not corrupted. That's what your media wants you to accept. Some of the people of the UN are corrupted, but Bush is way way way more corrupted, let's not forget that. The UN is very important for peace on Earth, and USA does anything they can to undermine it. Charity is not welfare. Tent cities outside Los Angeles anyone? You are currently interfering with Chavez' government in Venezuela: you want him to be removed from power, and you (well, not you, it's not your fault, it's your government's fault, that you unfortunately voted for, without knowing what is gonna happen) do anything you can to achieve it. You don't need all that guns. Who is going to invade Washington? no one. So let's stop talking fantasies for a minute... You are not doing this in any degree that's effective, because drugs is a valuable way of controlling the population and foreign affairs. For example, you are not burning the opium fields in Afghanistan, where most of the world's drugs come from, even though the highest number of AWACS aircraft patrol the area, and most US satellites are pointed towards the area as well. Opium production has increased 70% after you invaded Afghanistan.I agree with you, but the concept of a military organization that only some countries can be part of automatically makes other countries which are not part of it to be enemies. It would be much better if there was a global army sponsored by the UN, for the same reason as NATO.
To put it differently: many people see NATO as the imperial army of the United States. Not good, if you ask me.
Welfare in the form of charity is the biggest joke this side of Keynes-ian economics! modern capitalism has made people believe, through propaganda spread by media, that charity is the only acceptable means of helping the less fortunate. This is, of course, a trap setup by the central government (in any country, it's almost the same now), that is directed by those rich guys that control the media and the means of production, in order to be able to control how much welfare is given to the poor. In times of economic crisis, the charity system allows the rich people to take away welfare and save themselves from becoming less rich...on the other hand, an organized social welfare system requires a steady flow of money towards it, something that the rich people don't like.
Actually, it would take about 6 months/1 year to regain the former image, in doing the following:
1) remove armies from around the world; restrict your armies for your defense only.
2) dismantle NATO.
3) work in the context of the UN organization.
4) study history and support the right view historically (in cases of Israel vs Palestinians, Turkey vs Cyprus, Tibet vs China, Greece vs Macedonia etc).
5) stop interfering with countries of the former Soviet Block.
6) dismantle Guantanamo.
7) recognize the International Court of Justice.
8) sign the Kyoto agreement and act on the environmental issues.
9) improve social welfare.
10) stop interfering with South America countries.
11) minimize weapon production.
12) start a military campaign against drugs; burn all the drug-producing fields around the world (the ones that your satellites know about).
If you did only half of the above, your image would improve in a minute.
Easy: people that don't have a job are terrorists. People that don't want to enlist to the armed forces are terrorists. People that do not want to see "progress" like cutting down forests and building malls are terrorists. The list is endless, really.
Kosovo does not have oil, but it has gold, lignite, cobalt, cadmium, zinc, silver, nickel, bauxite, magnesite, in very large quantities:
http://www.kosovo-mining.org/kosovoweb/en/mining/minerals.html
It's still a war about resources, just like pretty much all wars on Earth were about resources.
It sounds more like Q from Star Trek than the Christian God...
But decreasing taxes also does not help the economy, if the decrement is on the taxes that rich people pay. Tax decrement must be uniform on all classes of society, and of course proportional to the income of each person: the rich people should pay more, the poor people should pay less.
I'll go one further: Anybody that supports the war should volunteer to participate in it.
I'll bet you that all those war supporters that happily cheer "go America" as they see the troops from their comfy living room will suddenly change their minds about this bloody war if they have to do it themselves...
You don't even need colors to detect cycles; all you need is a flag.
But I was talking about cycle detection at compile time, i.e. statically.
Even if cycles can be detected at run-time, it's still not as good as a solution as garbage collection, because if cycles are detected only in debug mode, then it means testing should have 100% coverage, which is something impossible in practice.
And doing it in C++ is very difficult, because it needs support from the compiler.
And you don't know how to read.
I never said otherwise.
I never said that they don't. I know and understand very well how and what rvalue references and move semantics solve. You don't seem to understand how problematic move semantics are.
Allocation/freeing is expensive because garbage collection is not used.
Nothing is saved by that. If you examine the examples given by Stroustrup himself (for example, on artima.com), you'll see the exact same problems that plagued auto_ptr. I guarantee you a massive outcry against move semantics by most C++ programmers.
But that's only because (in current STL), heap data are not shared! Your logic is circular: "new STL with move semantics is way faster than the old STL because of data moved around". Well, if there was garbage collection, your data could be moved around without any problem, wouldn't they?
I don't understand why you keep telling me that rvalue references are connected with garbage collection. I never said that. All I am saying is that move semantics is bad, and if gc existed, there would be no issue to solve.
If GC is accepted, then move semantics will not be required, and hence rvalue references will not be of much use, since value copying would be pointer copying.
I don't believe that the C++ committee really likes garbage collection. It's obvious, from their replies in the various forums. They believe in manual memory management, no matter what everyone else (provably) says.
Yeah, there are two things I'd like to see before I get too old to be a programmer: a) Duke Nukem Forever and b) C++ with garbage collection!!! Let's not kid ourselves, it will not happen.
This kind of double speak is meaningless to me: until I see GC in the language, it is in a rejected state. What I care about is for my programs to work without a problem, I don't give a dime about the C++ committee.
Although you start off on the right track, you make some mistakes on the way. Let me please point them out for you.
Not at all. IBM even has a real time Java (hard real time).
No, that's not true either. C++ has RAII, so the point is not valid.
No, it does not. All that's required is CAS operations.
It depends on what your destructor is doing. Under GC in C++, resource management would be managed with RAII, so there is no problem with deadlocks and stuff.
Agreed, GC needs to be integrated with the language.
You mix two totally unrelated domains. A OS kernel can have GC, but usually it is too low level to have one. On the other hand, a media player can have GC, since a media player does not constantly allocate and deallocate memory blocks.
They don't, in 99% of the cases. I belong to a group of programmers that make Java applications (as well as C++ apps) and that Java programmers worry about GC is all but a myth. It's only when there are libraries that are not well thought out that GC is a factor.
That's because their stuff does not contain cyclic references.
Not if the reference count is embedded into objects.
Don't underestimate the power of cycles! cycles can be introduced indirectly, through inheritance, and then it's very very difficult to track them...trust me, I've been hunting a memory leak introduced by a subclass which obtained a shared ptr from a factory interface, only to discover that the the base class was already already referenced somewhere from the object returned by the factory; the cycle was not obvious, until the program accumulated lots of craft after a long operation.
In my opinion, move semantics arises from the fact that Stroustrup thinks complex data structures can have value semantics.
The C++ standards committee can not agree on a GUI model, that's why they abandoned it (the excuse was that half of the people wanted a Model-View-Controller framework, the other half a simple callback-driven framework).
Furthermore, according to them, who needs a GUI library for C++? no one. C++ is a systems programming language, get it? (despite the fact that it's not used anywhere as a systems programming language)...
[/sarcasm]
Totally agreed, and not only Stroustrup, but also the other members of the C++ standards committee.
Their latest monstrosity is move semantics, i.e. data allocated on the heap are moved around and freed by the last object that has their ownership. Move semantics work just like auto_ptr, i.e. a newly constructed object gets the ownership of the data...this guarantees disaster, because in a complex expression/statement block you will not be able to tell which destructor really destroyed the data...
And all this because they deny to fix the language and put garbage collection in! with GC, move semantics would not be required, as the shared data structures would be deleted only when not referenced by any code. And their excuse for not putting garbage collection in C++ is just as lame: "some people will react against it!" even if GC is totally optional!!!
You want a list of C++ applications that have crashed on me one time or another? here it is:
U-torrent, Deluge, Firefox, Internet Explorer, Windows Explorer, Microsoft Word, Microsoft Visual Studio 6, a lot of games, MAME32, and many others!
On the other hand, I can't remember a Java app that regularly crashed on me now or in the past.
The only reason for this situation is that C++ is a horrible mess of a programming language! Stroustrup's denial has cost million of dollars in the industry, and quite a few thousands in my company from bugs resulting from the horrible C++ mess...
But garbage collection is faster than manual memory management, especially for computationally complex problems: the least you want is to pay the price for the allocation/free algorithms while your computation needs all the available cycles!
I don't know why you where modded insightful, but your comment is totally wrong, just like Stroustrup is.
First of all, the new move semantics bolted onto the new C++ will be a complete disaster for most programmers, just like auto_ptr was. The only reason move semantics exist is because there is no garbage collection.
Secondly, garbage collection is FASTER (repeat, FASTER) than manual memory management! If you have ever done any tests, Java blows C++ out of the water in memory management tests.
Thirdly, the problem of horrible bugs and completely incomprehensible code is due to C++'s complexity, which is the result of bad language design, and the lack of garbage collection, in particular.
Since you are doing computationally intensive complex problems (I suspect of mathematical nature, isn't it so?), you might want to try Haskell. You'll be surprised on how easy it is, since it's actually executable math.
It depends on the type of women you want to approach. My comment was about long term relationships which are based on mutual trust...a relationship that may lead to a family.
Personally, I find these relationships more satisfying than short intense erotic relationships. There is much enjoyment to be had from hand holding as well as from making love.
If you want to attract the more adventurous women, you can try to play the really daring type, the playboy, the guy with the Harley Davidson which is an easy rider, but would it be really you? women can easily understand pretenders. I prefer that women like me for what I am, even if what I am is not very exciting or adventurous...
Not the programming language, of course! Smalltalk with a girl you like, and if she really likes you, the conversation will go on without any embarrassing pauses. Smalltalk allows us to relax and let ourselves be, and any underlying feelings usually surface.
There are some subtle clues to as if a girl likes you; for example, if, after a long conversation, she starts to touch you. Or if she turns her body towards you while she speaks.
Of course none of the above guarantee 100% that a girl likes you. But it's a good start.
Remember some general principles: be clean, be gentle and polite, show interest in your partner, be sincere.
Also remember that one of the most important feelings for women is the feeling of security: try to make them feel relatively secure; women have a wide spectrum of feelings but they are usually reluctant to show them until they feel nice and welcomed to the person they speak to.
Finally, also remember that for women, sex is more a psychological operation than a physical one. Sex is not the same for the two sexes. Women are mentally and emotionally aroused before physically aroused, so try to care for them!!!
You are right, and I've been telling this for quite a while (for example, my most recent post here).
I have also suggested this in other sites (example: LtU), but the response was "oh no!" and "disaster!"
For me, it's clear that the so called 'standards' for development of web applications are of very low quality: badly thought out, inefficient, without any concern on security. Perhaps if more people recognized this, the community would be pushed to create something better...
If it's so, then how come Linux distros come bundled with everything but the kitchen sink?