|
My answer below:
I reduced the occurrence of the problem by splitting some methods and using a dictionary instead of large switches that cause stack bloats. Now a simple recursive factorial method works with 400 instead of 46, that is almost 900% better
Natza Mitzi
|
|
|
|
|
I reduced the occurrence of the problem by splitting some methods and using a dictionary instead of large switches that cause stack bloats. Now a simple recursive factorial method works with 400 instead of 46, that is almost 900% better
Natza Mitzi
|
|
|
|
|
A while ago I inherited a project that was full of the following :
if( CString( str1 ) == CString( str2 ) )
{
}
That was the most annoying thing for a variety of reasons. I should mention that this was a communications-oriented project and all of the character strings had defined sizes so that as OK but apparently someone had an aversion to the strcmp function. I couldn't believe it. Even when there was an actual CString object, like from a dialog, they would cast the other argument to a CString to do the comparison. I guess they didn't know that CString has a const char * operator.
|
|
|
|
|
That's typical of people without C background.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: That's typical of people without C background.
I think you mean C++.
|
|
|
|
|
leppie wrote: think you mean C++.
Well, C is the C++ 's background foundation.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Well, C is the C++'s background foundation.
But C has no types (well not like the OP has ).
|
|
|
|
|
leppie wrote: But C has no types
That's precisely my point.
Only with a (solid maybe) C background he would appreciate the introduced overhead. While, for instance, VB6 people (don't blame me for the cheap shot) maybe used to thinking String is a native type.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
BTW Suppose CString equality operator implemented in a Java -string fashion: possibly the fun would be more.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Who knows what the compiler and linker will made of this statement.
I try hard to make parameters const so it can better be optimized.
Greetings from Germany
|
|
|
|
|
Nothing wrong with that statement. Creates two CString objects and do case sensitive compare with CString == operator.
|
|
|
|
|
steveb wrote: Nothing wrong with that statement
In fact it isn't wrong. But it is unnecessary (just added overhead).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if this was the production code of some server that kept on crashing while communicating with clients, the code snippet mentioned is the exact thing I would put in in place of the strcmp which in unsafe. yeah yeah there is strcmp_s, but that just come out in 2005. Code is probably older.
|
|
|
|
|
Well using temporary objects to wrap unreliable code doesn't make sense to me.
I simply won't use unreliable code on a server.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What, checking for null is to sophisticated for you?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
After the description I have given, you see nothing wrong with creating two objects to do a string comparison and doing this every single time that two strings need to be compared in the app ?
All righty then.
This was in an industrial automation system. That might give a clue as to why I consider it to be horrific. Or not.
|
|
|
|
|
|
Star Vega wrote: I'm working on this horrible legacy... to give you an example, the main form contains about 48000 lines of code, containing gui, business and, yeah, all the data access. Nice, isn't it?
It's a horror. My former company had an MFC application featuring more than 100000 lines of code for the frame window.
Star Vega wrote: But here's (yet) the best part: if you want to display a checkbox at certain moments, why not surround the checkbox code in the form's designer code (auto-generated, remember) with an if-statement?
The difficult part is (you are guessing right!) that you have to rewrite this code very often (whén their code disappears, they don't have a clue). Clever as they are, they attached this text file with the code you have to rewrite so often.
Horror keeps running.
Star Vega wrote: By the way, they offered me training - should I start looking for another company?
I did.
[added]
Someone of my former company saw this post, I suppose...
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The designer file is meant to hide the code used for the GUI. So better leave it hidden and do not try to touch it
VladovsoftSoftware products for fitness and health club management, storehouses, shops and barcode generation.
|
|
|
|
|
Really? I will forward this message to my colleagues...
|
|
|
|
|
Did you suggest they try .Visible=false ?
Or add it dynamically?
|
|
|
|
|
Star Vega wrote: they offered me training
Sounds like the tail wagging the dog.
Here's what you should do:
1. Find new job.
2. Offer them training.
If they refuse, give your notice. If they accept, withdraw the offer of training stating that it's a lost cause and give your notice.
Good luck!
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
Star Vega wrote: when their code disappears, they don't have a clue
It's unbelievable. Are you embellishing the story or all of them are really mind-disabled?
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
I wish it was a joke... there are 2 'developers' for this huge application. The company decided to replace this legacy.. finally.
By the way, I found their Access DB: it exists of 125 tables, in which I found one (1!) relation (no referential integrity, what did you expect?)
modified on Tuesday, July 22, 2008 7:55 AM
|
|
|
|
|
What was your post? Don't delete, others may find it interesting. Odd how you got 4 five votes for it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|