Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

dot-net: buggy, buggy, buggy (as hell)

I have spent about 4 hours trying to get a POST to work.

HttpWebRequest.GetRequestStream() hangs on me every time, then times out.

Yes, I tried everything the help for that method suggests.

I wonder - how come that in Delphi things just work with a lot less "tweaking"? Why does Indy work so much better than the .NET objects written by the allmighty Microsoft?

I am not pissed at MS in general. I am pro-Microsoft.

But the .NET Framework is extremely buggy. I run into bugs almost everywhere. Then I spend a day or two working on the problem.

In 20% of the cases I solve the problem, in the rest of the cases I don't.

Maybe I'm a poor programmer, but, then, why have I succeeded in writing commercial, successful applications? Why am I considered by my peers to be a good programmer?

Maybe there is something about the .NET Framework that escapes my understanding, and I can't grok it. But it's very unlikely that it's so.

So, I am beginning to think that .NET = a collection of a million bugs.

:-(

Crane Michael
Thursday, July 24, 2003

I think J. may delete this post, but:

On the site, you say that VS .NET is Delphi 7, and Delphi 8, and Delphi 9.

Maybe, as a concept.

But it's amazingly buggy. Maybe VB programmers are used to the "bugs in every library class" approach, but us, Delphi programmers, are not used to that.

From the bugs point of view, Delphi = VS .NET 5.0 !!!

Crane Michael
Thursday, July 24, 2003

When I work with Delphi, I see a tremendous number of bugs, wonder what Borland's QA department was thinking, and wonder why the heck they insist on making things so difficult that are so easy to do in VB, VC, .Net, etc.  So who is right, me or you?  The answer could very well be neither.  When you are familiar with a platform, you tend to overlook the annoyances because you're used to them. 

By the way, the problem you described in "System.IO.Stream is seriously broken" doesn't occur for me.

SomeBody
Thursday, July 24, 2003

I don't see the problem either...

PS : You may want to look into using the StreamReader class.  You can specify ASCII encoding up front so you can use a char[] instead of a byte[] and don't have to call your Ascii2Unicode().

Rick Childress (www25.brinkster.com/rchildress)
Thursday, July 24, 2003


Stream s = req.GetResponseStream();
string data = null;
using(StreamReader sr = new StreamReader(s, System.Text.Encoding.UTF8)) {
  data = sr.ReadToEnd();
}

Pretty straightforward to me...
The HttpClients may have their quirks, but they don't seem extremely buggy to me.

rick
Thursday, July 24, 2003

Yes.

In the line:

Stream s = req.GetResponseStream();

your beloved .NET library hangs. :-( And I can't step trough the library function's source code itself, like I can in Delphi.

Ever eat chocolate with lots of peanuts included? Well, .NET is the chocolate, and the peanuts are the bugs!

:)

Crane Michael
Friday, July 25, 2003

I created an example that gets the stream for this uri and it works just fine.  Would you mind posting a complete example?

Rick Childress (www25.brinkster.com/rchildress)
Friday, July 25, 2003

btw, you said you're doing a POST right?
how are you getting the data to send?
is it possible you've told .NET to grab data from somewhere, so when you try to read the RESULTS the framework is WAITING on the OUTGOING data?

it's been a while since i did this, but this was the hardest part about the .net http api, you can use some async code to do it 'right'.

mb
Friday, July 25, 2003

You seem to be missing the point.  GetResponseStream does NOT hang for any of us.  Therefore, it must be something that you're doing.  Maybe whatever you're doing exposes a bug but the more likely answer is that GetResponseStream is deliberately waiting on something.  Are you sure the network address you're pointing it at works?  Have you tried something like "http://www.microsoft.com" as test?

SomeBody
Friday, July 25, 2003

I think I know what you've run into, I hit it too now that I think back.

Between calling GetRequestStream and GetResponse, you need to close the stream you've written to. I'm guessing you didn't do that.

mb
Monday, July 28, 2003

*  Recent Topics

*  Fog Creek Home