|
Christian Graus wrote:
My goodness. Why on earth are they maintaining this code ? Surely these classes remain just a stepping stone before people find out about STL ?
Hey, there's a lot of legacy apps out there that are still being worked on, upgrading the compiler is a nice way to get the advantages of the new optimizations on older code.
Most companies don't rush out and say, "Hey, a new compiler, lets re-write all our old MFC code!"
The old code works. It might not be the best design, but it works, its been working for years and it's not cost effective to rewrite it.
|
|
|
|
|
Anonymous wrote:
Hey, there's a lot of legacy apps out there that are still being worked on, upgrading the compiler is a nice way to get the advantages of the new optimizations on older code.
Um... the starting point for this was the claim that the new code gives such optimisations as *breaking* the old code. How is this a good thing ?
Anonymous wrote:
The old code works. It might not be the best design, but it works, its been working for years and it's not cost effective to rewrite it.
Fair enough - I do not advocate changing it if it works, but if the new versions don't compile the old code, then the two questions are:
1. What do the legacy app owners you champion get out of that ?
2. Seeing as it IS a bad design, why are they working on it at all ? They would do better to leave it alone and presume that anyone coding post VC5 uses the STL anyhow, but the old stuff remains for legacy apps.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Whatever written below are not my comments, i am just copy-pasting them from here[^]. So please do not consider these as my own comments, as you may visit the link i provided
One of the most common usage of strings is to cancatenate strings using operator +=. In general this operation doesn't seem to be very efficient. Here are some of my test results:
For my testing, I cancatenate a string of 100 char long 10000 times together.
Using MFC's CString as (just pseudo-code)
CString str, s('0', 100);<br />
for (int i = 0; i < 10000; i++)<br />
{<br />
str += s;<br />
}
It takes about 70 seconds on my machine .
It is almost the same result (actually 68 seconds) if std::string is used .
Interesting, I was quite surprised that the same thing can done in VB in 49 seconds - who said VB is slower?
|
|
|
|
|
Shamoon wrote:
Interesting, I was quite surprised that the same thing can done in VB in 49 seconds - who said VB is slower?
Keep using it [VB] for your project then!;P
Do you have a better piece of code to present? (I don't like your example)
|
|
|
|
|
Infact there are many different ways to do a single task in C++ and one is more efficient that other. But fact is a fact, and the fact is that both std::string and CString concatenation operation with operators like + and += are slow as compared to VB sting operations. Infact the speed can be increased many folds if we use reserve() in case of std::string but i've not seen any such possibility in CString .
Ernest Laurentin wrote:
Keep using it [VB] for your project then!
Have you ever performed ADO operations in VB?? Just try to access a stored procedure from SQL server database both via VB and VC++. You can notice that VB is extremely fast in this case. As such you've to perform few mandatory data type conversions in VC++ related to BSTRs e.t.c. VB does this internally , but really it is fast. Also notice the CPU utilization in both cases which is high in VC++ sample than VB one.
Ernest Laurentin wrote:
Do you have a better piece of code to present?
The guy has provided a link, one may go and check there the whole story behind the example he given.
Also as far as i remember there was a discussion at CP lounge few months ago related to performance comparison b/w C# and VC++, and a link was provided where someone proved that even some mathematical operations inside do-while loop of C# are faster than VC++
BTW: Yes C++ is faster than any other, but VC++ is not always a very good tool to compare performance. Just try Intel C++
|
|
|
|
|
Daniel Martin wrote:
Infact the speed can be increased many folds if we use reserve() in case of std::string but i've not seen any such possibility in CString.
CString::GetBuffer(int nNewBufferLength) can do that too. Doing GetBuffer(65K) before the loop makes the += just do memcpy really, not reallocating the buffer anymore.
Back to real work : D-21.
|
|
|
|
|
I got it now (I visited the link!), I still think that one should not compare VB with C++ for performance!
Don't talk too fast, don't talk too much and don't talk to soon! - The wise man says...
|
|
|
|
|
Shamoon wrote:
Whatever written below are not my comments, i am just copy-pasting them from here:
Why ???
Shamoon wrote:
It takes about 70 seconds on my machine .
It is almost the same result (actually 68 seconds) if std::string is used .
Interesting, I was quite surprised that the same thing can done in VB in 49 seconds - who said VB is slower?
People with brains ? Are you familiar with the pet shop example ? The .NET and Java camps are fighting endlessly over one example as if it proves which is better/faster, and all it proves is the ability to perform one test. The person who posted the above is an idiot, and if you posted this because you think this proves VB is faster than C++, then you're an idiot also.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
People with brains ?
All people have brains.... proved medically!!
Christian Graus wrote:
The person who posted the above is an idiot
If you visited the link, where the original message was posted, many peoople replied and no one called him idiot.
Christian Graus wrote:
and if you posted this because you think this proves VB is faster than C++, then you're an idiot also
He didn't claimed that VB is fast. Whatever he wants to ask is clear from the subject of his thread.
|
|
|
|
|
Daniel Martim wrote:
All people have brains.... proved medically!!
Many do not use them....
Daniel Martim wrote:
If you visited the link, where the original message was posted,
I probably should, it's possible he's been quoted out of context here.
Daniel Martim wrote:
Whatever he wants to ask is clear from the subject of his thread.
What about these thing ? I'm not sure how to read the post except as a claim that VB is faster than C++ because of some isolated test involving strings.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
All people have brains.... proved medically!!
Many do not use them....
Strange, it's usually those that call people idiots that seem to fall into this category.
VB is faster than C++ doing some things. That's been proven. Overall, however, C++ is faster than VB.
Going on a VB bashing spree is not going to change either of these facts. Also, as time goes on, VB's speed will continue to increase, eventally the two languages will not be far apart as far as 'faster software' goes and it will become a matter of using the best tool for the job at hand.
|
|
|
|
|
Just what I need, an anonymous illiterate first thing in the morning.
Anonymous wrote:
VB is faster than C++ doing some things. That's been proven. Overall, however, C++ is faster than VB.
That's what *I* said.
Anonymous wrote:
Also, as time goes on, VB's speed will continue to increase, eventally the two languages will not be far apart as far as 'faster software' goes and it will become a matter of using the best tool for the job at hand.
Actually, .NET is going to slow C++ down. It's more true that as processors get faster, it will matter less in terms of speed what language is used. I think we're already there. The main reason for me to use C++ is that after using VB I feel dirty - it's simply a bad language from where I stand. Microsoft know as much - do you think they will keep VB AND C# ? They don't differ that much, you know.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
The main reason for me to use C++ is that after using VB I feel dirty - it's simply a bad language from where I stand. Microsoft know as much - do you think they will keep VB AND C# ? They don't differ that much, you know.
Those who code in C seem to say the same thing about C++. And those that code in assembly seem to say that about C.
Yes, Microsoft will keep Visual Basic and C# for the foreeable future. VB sells, a lot, it lets people learn to program without all the baggage that C++ brings along with it.
Of course it lets the 'uneducated' developers write software. Big deal. Ask a mainframe operator what they think of the PC in the workplace. Ask the average PC systems admin what they think of the Mac.
When it comes down to it, real developers, good developers, don't care that much about the language. The language is not the program, the logic is. The rest is just syntax.
|
|
|
|
|
Anonymous wrote:
VB sells, a lot, it lets people learn to program without all the baggage that C++ brings along with it.
You mean like style ?
Anonymous wrote:
Of course it lets the 'uneducated' developers write software. Big deal.
You're right - it is a big deal. Answer me this - what proportion of 'programmers' nowadays code in VB. Now ask yourself - what proportion of the code YOU run is written in VB. I judge by the fact you hide behind an anonymous post that you're a VB programmer, who has been let out into the real world for a moment. Don't count the stuff you wrote. Now ask yourself that again. What does that tell you about the QUALITY of code written in VB overall ?
Anonymous wrote:
When it comes down to it, real developers, good developers, don't care that much about the language. The language is not the program, the logic is. The rest is just syntax.
True to a point. But every language has it's strength and any real workman chooses the right tool. VB is the right tool if you're in a hurry, or plain stupid.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Game over troll, I'm out of food.
|
|
|
|
|
LOL - by out of food, I presume you mean out of answers ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Well, it's already been said, but -
so what?
There are plenty of examples, even some here on CP, that demonstrate specific bits of code that execute faster on VB. They are mostly irrelevant though - you generally don't make decisions on the language used for a project based on examples such as these, unless they will be composing the vast majority of your program's execution time (for instance, FORTRAN for heavy number crunching).
This example is especially bad however, as it performs something that VB, which offers only a few ways of representing strings, *must* be optimized for, vs. CString and std::string, which are meant as a convenience, not an optimization. If code such as this were ever used heavily in a C++ program, any programmer worth his salt would pre-allocate a buffer, or at very least alter the allocation settings for his string class of choice to more efficiently handle frequent re-allocation.
So back to the point already - what does this have to do with VS.NET - Everett?
Shog9
------
Rather hammer futiley at the locked door than just sit and ignore it. Obviously finding a way to get through the locked door would be even better though. - Paul Watson, My Ignorance
|
|
|
|
|
Well, everytime you use concatanate a CString a memory reallocation occurs, then memory copying and then original memory is freed. In situations like this (you use += for 10000 time) you should consider reallocation a big buffer at first like this:
CStrring str;
str.GetBuffer (1024000);
str.ReleaseBuffer ();
Try this one!
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Isn't that in VC7 already ?
or is it limited in some way ?|
Lets remove the arguements on this !! [joke intended]
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
No, it only works for operators, the examples to illustrate Koenig lookup that are in the standard do not work in VC7. I know this because I researched it extensively in writing an as yet unpublished article on namespaces for DDJ. VC is the only compiler I could find which makes a hack of Koenig look up, every other compiler I tested, commercial or free, compiled the examples in the standard correctly, and more importantly, failed to compile code which shouldn't work, but does in VC.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
k, Thanks Christian.
As you might know, I haven't upgraded to VC7 still.
So I've been watching writeups and the like to know what I was missing out on.
One of the main reasons I would have upgraded was for that.
Unsure if I would have used it, ?? But when you have an ability you sometimes find uses for it.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
Colin Davies wrote:
But when you have an ability you sometimes find uses for it.
Exactly what I have been saying to those who call the missing C++ features useless. How would we know ? We've never been able to use them.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
To a degree this is true. In this case Koenig lookup seems to be the more powerful and logical solution. So it really does seem to be a "Good Thing". But then again, I don't see not having it as a show stopper.
Many times, some of the stuff I see is nothing more than program masturbation. "Oh, look at all the cool stuff I can do now!!!". Sure, when you are done you feel good, but it doesn't get the job done. But like I said, I don't think that is the case here.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Russ Freeman wrote:
I got the distinct impression that (when using the help at least) I was using a tool that the authors had never used.
It's a little strange, isn't it. Troy Marchand was telling me that he wrote a small add-in that fixes the F1 issue. It took him an afternoon. If you want to hear a man swear about the developers at Microsoft then I'll give you his phone number. The key phrase to mutter is 'Hey - isn't VS.NET help great!!'
cheers,
Chris Maunder
|
|
|
|
|
The resource editor bugs mentioned here on CP?
Hehehe. Between dynamic help not wanting to stay away and the new resource editor, I don't know which "feature" I loved to hate the most.
Nice to see those will be fixed.
I do have to say (brown nose) that I have been using VC7/VSNET for nearly 9 months now and I do like it.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|