 |
|
|
 |
|
 |
Hi,
This article has obviously had quite a lot of attention over the weekend. To be clear this is a sponsored article, which we paid code project to place here, as stated at the top of the page. The content of the article was written by Bryan Cattle and any editing done by Red Gate was for style rather than content.
There seems to be a lot of criticism of the Princeton team, both here and on Slashdot, for missing such an “obvious” mistake. If I had written code which managed to drive a car 9.8 miles through the desert I would be incredibly proud. I feel that this vitriolic criticism of a group of undergraduates who had the gumption and the vision to go out there and create a software and hardware solution to drive a car across a desert is very disingenuous. They had a hard deadline and did an incredibly good job given the constraints on their time and budget.
They had tried to fix the problem they were facing and had put in a workaround so that they could compete on the day. Unfortunately, they had not used a profiler which could have shown them the underlying problem.
For me the story is a great illustration on why having the correct tools when programming is vital – regardless of if you are developing in C, C++, C#, SQL or any other language. At Red Gate we are committed to providing these tools and ultimately, due to the attention this article has had, I believe that we were right to publicise it and that hopefully the message that it is easier to succeed if you have the right tools is getting through.
Most of all I want to congratulate Bryan and the rest of the team for trying and succeeding to do something incredibly hard.
James
-- James Moore Head of .NET Red Gate Software Ltd
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
Certainly a great accomplishment, no argument there.
However, two words and the probem would've been found much faster.
Unit Testing

Of course, they would have to know to write the test that said "When the object is 10 miles back, we should delete that object and unregister it." If they had written tests and just missed that one . . . well, hindsight is 20/20.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
...That thought that using a managed language was a good idea for this kind of project. The trials and tribulations of inexperienced developers aside*, I want to know why students that are learning about developing a real-time system (driving a vehicle at speed is pretty real-time), using a platform that, IMHO, is not necessarily geared for performance, but for (code-level) safety.
I shudder to think about a production system in a vehicle on the road travelling at speed, negotiating a lane change to pass while coming out of a curve, when the runtime decides that NOW is a good time to stop everything and start garbage collection.
Sorry, but the chance of that happening just sends chills down my spine. Couple that with the fact that students were allowed to go down such a path is downright horrifying.
Peace!
* This also serves as a good example that no matter what language/platform you use, you still need to be skilled to use it correctly. .NET may take care of a lot of the details for you, but you still need to know what you are doing.
-- modified at 15:06 Sunday 18th November, 2007
Given the low-weight votes, I guess that it needs to be explained to the less experienced that "geared for performance" in this context implies real-time performance, as the system being developed is a real-time system. The last time I can remember even hearing "real-time" and ".NET" in the same sentence was an ACM paper regarding a set of requirements for a real-time .NET system.
-=- James Please rate this message - let me know if I helped or not!
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
| Sign In·View Thread·PermaLink | 2.71/5 |
|
|
|
 |
|
 |
1. This line says a lot:
Because we didn't know why this problem kept appearing at 40 minutes, we decided to set a timer. After 40 minutes, we would stop the car and reboot the computer to restore the performance.
I'll tell you guys why you lost: it's because someone on your team had a really bad case of Windoze/Winblows scapegoating. Before even being level headed enough to look at the Working Set of the process in Task Manager, decided to just blame Windows and restart the entire computer rather than just the process.
Happens all the time. A couple years ago my internet connection was screwing up, and my ISP insisted it was Microsoft's fault for letting Blaster loose. Months later they came to replace my modem and everything was fixed.
2. If I were on this team, I would have written this article regardless of whether or not Red Gate endorsed it. It's called "reflection" and it's a good way to learn from mistakes. And it's a geek's equivalent of a bar story. So stop accusing Red Gate of "advertising" as if it's some sort of crime.
|
| Sign In·View Thread·PermaLink | 1.67/5 |
|
|
|
 |
|
 |
Wow, I count 14 people on the team and they couldn't figure this out?
Seems like a classic PEBKAC problem to me. There are two reasons things don't get garbage collected: not properly dereferenced or they're still listening to an event (I know, effectively the same reason). The article actually says "deleting" objects, which makes it sounds like their custom objects were missing or not correctly implementing an IDisposable interface.
All in all, it's cute that the tool helped them, but it's really just a tool fixing up their rookie mistakes. I'm sure that ANTSProfiler has some uses, and the results were pretty significant in this story, but there were a ton of other ways that this thing could have been solved.
|
| Sign In·View Thread·PermaLink | 3.40/5 |
|
|
|
 |
|
|
 |
|
 |
After all C# is essentially Java for .NET. Netbeans and VisualGC can accomplish the same thing for free, put the $300 (that you may spend on ANTS) in a savings account
****WAO, I haven't posted to CP in ages!!!***
Looking for me in cyberspace? I am the electron with the red hat, occupying 3rd sit on the left of the data bus. by the way, perl stinks.
"I believe god invented man, because he was disappointed in the monkey" Mark Twain
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
Java will have the same problem. As does ActionScript. And as does any managed language. It is something programmers should be aware of.
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
Native languages like C have similarly obscure resource management bugs as well, albeit not exactly of the same type.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Such as? I would love to hear of a resource management bug that is intrinsic to C (or C++).
All of the resource management bugs that I have ever come across involve developer error, not the underlying management facilities themselves.
o Allocating and then not deallocating - developer error o Trying to use memory that was not yet allocated - developer error o Trying to use memory after deallocation - developer error o Naive use of dynamic resources - developer error/ignorance o Buffer overrun and/or underruns - developer error o Cross-heap mixups - developer error o Etc.
Peace!
-=- James Please rate this message - let me know if I helped or not!
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I'll rephrase if it's necessary to be correct in every literal term: I meant to say that similar mistakes can be made in C, not that C itself has similar mistakes.
I thought it'd be sort of obvious, given that neglecting to free a reference is also a developer error. It fits right next to the category of "allocating and then not deallocating".
|
| Sign In·View Thread·PermaLink | 3.00/5 |
|
|
|
 |
|
 |
And to post this on Code Project no less.
1. This is a thinly veiled add. While the software tool doesn't sound so bad, I will refuse to ever use it in a project because I detest this type of snake-oil. Illogical that may be, but this whole 'adticle' feels wrong. 2. Your software was flawed by design. 3. myObjectInstance.OnDetectObstacle -= new SensorySystem.OnDetectObstacle(Senses_OnDetectObstacle);
4. Also... minor note.. is '10k lines of C# code' supposed to be a lot? My WOW Bot has 8.5k lines purely for the thinking/parsing/planing side of things. In the Visual Studio world 10k lines of code is probably 3k lines of brackets....
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
malakai wrote: 1. This is a thinly veiled add. While the software tool doesn't sound so bad, I will refuse to ever use it in a project because I detest this type of snake-oil. Illogical that may be, but this whole 'adticle' feels wrong.
It says at the top of the damn article that this is an informative review of a product by a sponsor. Please tell me how this is a "thinly veiled ad". It's very clearly an ad, and there's absolutely no shame in it because it's an informative ad. Grow up.
malakai wrote: 2. Your software was flawed by design.
Blanket statement. AKA BS.
malakai wrote: 3. myObjectInstance.OnDetectObstacle -= new SensorySystem.OnDetectObstacle(Senses_OnDetectObstacle);
Don't tell me you've never made that mistake before.
malakai wrote: 4. Also... minor note.. is '10k lines of C# code' supposed to be a lot? My WOW Bot has 8.5k lines purely for the thinking/parsing/planing side of things. In the Visual Studio world 10k lines of code is probably 3k lines of brackets....
Why the hell are you writing WOW bots?
|
| Sign In·View Thread·PermaLink | 4.33/5 |
|
|
|
 |
|
 |
You missed one item:
If you think more lines of code to accomplish a task are better, you need another hobby.
|
| Sign In·View Thread·PermaLink | 4.00/5 |
|
|
|
 |
|
 |
I hope you learned your lesson that you should test your software before you actually use it. 
You could have let a second program generate mock obstacles for you, and you could have done some load and performance testing.
Just taking a heap dump would have showed you your issues.
I hope you are not going to make this a common practice to release poor tested code into the wild. You will blow up space shuttles.
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Yes you can:
http://www.codeproject.com/csharp/weakeventhandlerfactory.asp
I am not familiar with the code to know if this article even applies. But the idea is that you don't have to remember to remove the reference. After all, that is what automatic memory management is all about.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
I saw that (that's how I got to this article this morning.) The SlashDot article is written as if this were a bug in C#, and cherry picks quotes from the article that totally misrepresent what really went on.
They say "It was written in Microsoft's C#, which isn't supposed to let you have memory leaks" then go on to quote how the program ground to a halt and made them lose the race.
I think the author read the article and was either too inexperienced and unknowledgable about computer programming to understand that this was a bug in the code (that delegates are lists of pointers for example), or was simply malicious anti-Microsoft tripe.
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
|
 |