|
There is undoubtedly another DLL that inspects this DLL's IL to ensure the code has not been tampered with. If it finds that somebody removed the seemingly extraneous if statement, it will cause ThreadAbortExceptions at random intervals.
|
|
|
|
|
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
I am going to guess that one of those blocks should be setting randomValue = false.
If so I would prefer this much simplier version:
randomValue = status == "something";
However, when I see code like that I have to check everything around it for correct logic.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Setting a random value to true... that is very random.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
I'll guess that this code has been significantly reorganized and these are the only statements left from a major cutback.
Otherwise, we must assume that the author is insane.
|
|
|
|
|
there is an obvious flaw in this code, it should read like:
if (Status == "something")
{
randomValue = true;
}
else if (Status != "something")
{
randomValue = true;
}
else
{
randomValue = true;
}
|
|
|
|
|
System.Windows.Forms.MessageBox.Show
When used on "Web Application" actualy works on Visual Studio 2010 during debug runtime not a single warning or error.
Just to find out that once compiled and uploaded to be viewed online then you get ERROR saying it was only meant for local application. Then why the hell they don't even tell while you where debuging it took me about 4 hours to found this out.
you will get this error:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Beware of this .Net debuging st*p*d*ty! or maybe I was the problem
I was st*p*d to believe in some guy posting that this is better way to show message box on Web App.
|
|
|
|
|
You aren't the first to do that, and you won't be the last. I deal with maybe one Q&A question aasking "why doesn't this work anymore?" each week...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Developers often forget that to show a message box on the client computer, the code must be running on the client computer, but in case of a web app, the code runs on the web server. Use JavaScript's alert() to show message box in the browser.
|
|
|
|
|
Even worse are the possibilities that if this code did actually work, you now have a modal dialaog box open on the server waiting for user input. How many of those do you think can be spawned before some kind of memory error occurs?
-- modified 17-Jan-19 21:01pm.
|
|
|
|
|
I've come to a conclusion that the way that software get maintained, backed-up, ect. is a big problem area in computers today.
How many hours do I sometimes spend searching/downloading the correct revisions of software programs/libraries/functions. Lots of times the backed up files is found all over the place(Download something on this site, then that site and so on). We need a "mother system".
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
But you have heard of something like source control before?
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
Revision Control, Source Control, I include all those subject in my statement.
There needs to be a simpler, language independant, structured, singular way of
doing these things. Its too much time consuming and unstructured. The data is
scattered on servers across world.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
Probably not in this universe, unless you hire a secretary to gather together all that stuff for you.
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
How about an interface, 1 interface controls all
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
What do we have the MCP for
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
lol, yeah, the not so nice work part of being an MCP.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
I meant the Master Control Program from Tron
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
hehehehe, Exactly that.
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
MCP, what else could that mean? Most Clueless Professional?
"I just exchanged opinions with my boss. I went in with mine and came out with his." - me, 2011
--- I am endeavoring, Madam, to construct a mnemonic memory circuit using stone knives and bearskins - Mr. Spock 1935 and me 2011
|
|
|
|
|
hahaha, you got it. Apparently made by Microsoft
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
In near future Google is planning to give space to save your code online.
But your own project related code and documents, you have to maintain in your local server (TFS, VSS etc...), they are providing security.
-- Rushi
|
|
|
|
|
Here's a C code fragment that I recently came across. Not making this up!
if ( len >= 8 )
{
As you may understand, it took me a little while to figure this particular one out
modified on Tuesday, May 10, 2011 4:03 AM
|
|
|
|
|
I think such code should not be commented at all. I know someone who would comment
Such comments are really just littering your code with the obvious. It doubles development time and has no added value... If you need comments to understand that you are obviously not at your right place. A more helpful comment might be WHY the string must be at least 8 chars.
Your example is rather hilarious (or is that sad?) though
It's an OO world.
|
|
|
|
|
My point exactly, thanks. And not only does it double development time, it also puts a burden on the next programmer that has to maintain the code. What should (s)he do? Update the comment? Remove it altogether? In this example, the maintainer apparently forgot to update the comment.
|
|
|
|