|
Huh? I use goto when necessary (which is very rare).
|
|
|
|
|
goto bathroom.
goto kitchen.
goto pub.
They seem necessary
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Only the bathroom is a necessary.
|
|
|
|
|
Just an optional requirement..... 
|
|
|
|
|
I don't have the exact code, but a while ago I've seen someone do something like this in VB.Net:
sub codeHorror()
dim amount as integer
dim isTrue as boolean
amount = cint(textbox1.text)
' some unrelated code
isTrue = cbool(amount)
' Some unrelated code
amount = cint(isTrue)
messagebox.show(cstr(amount))
end sub
The person who did this had little experience with coding, but had done application design on paper (with PST'z) for almost half a year - proof of my school failing at teaching logically.
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
You know ... sometimes I think that the compiler should'nt compile such a code !! and display a message for the developer :"For God Sake What with the hell is that !!!"
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
Paperclip: I see that you are trying to... (scratches head) what exactly are you trying to do?
|
|
|
|
|
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
The other day I saw a code where the developer intended to check his code by displaying a message box in ASP.NET applicatoin if a condition is true, in order to accomplish this he refrenced the System.Windows.Forms assembly and called the MessageBox to display his message.
When running the code, it actually worked !! and displayed the message successfully !!!
I freezed when I saw this ! How come a windows form control message box is displayed on the browser ?!
Actually it makes all the sense to be displayed from a technical point of view ... but it will create a disaster when its really used !!! what actually happens is that when the MessageBox is displayed the thread of the process is freezed until the User clicks ok !!!! and what user is that ... figured out the trick ?!!?
Let me give an example : the application on server ABC and some user on machine xyz is browsing the application, now when he faces the condition and the message should be displayed it will not be displayed to XYZ User !!! it will be displayed on ABC server since its a server side call !!!!
Now he had no clue about that because he was in development time on his machine, and his machine in debugging is the server as well, so he was able to see the message box with no problem
It's a codding horror no doubt ... but it makes an asp.net developer thinks more realistic and deeper on the behaviour of his own applications !!!
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
modified on Sunday, May 17, 2009 3:59 AM
|
|
|
|
|
Samer Abu Rabie wrote: asp.net
You should have said that up front.
|
|
|
|
|
That's a multi threaded fail process alright
GSoC 2009 student for SMW!
---
My little forums: http://code.bn2vs.com
---
70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
|
|
|
|
|
You'd be amazed how many people writing asp.net code actually do not understand how/where it runs.
|
|
|
|
|
If it is intended for use in production code it is a real horror. If it is just a diagnostic messagebox that will be removed for production code then it is not too bad; the programmer has to be sure to remove it though
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
In a phone conference today with both technical and subject matter people, it was asked:
"So, we are trying to use a stored procedure for something other than a stored procedure?"
Yes, he is not a database person if you wanted to ask.
|
|
|
|
|
They likely meant that what ever was implemented using a stored procedure, should probably have been implemented in a different manner. Regardless, it is a poorly worded question that is more confusing than understandable.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
I'm with Chris.
Stored procedures are overused nowadays and are often used when a simpler technique will suffice.
|
|
|
|
|
|
It's a pity that this scheme for line-numbering does not work
|
|
|
|
|
OMG!!!!!!!!!!!!!!!!!!! ripe my eyes out now!!!!!!
|
|
|
|
|
I think a part of me just died. I counted at least 8 things wrong with that snippet
|
|
|
|
|
Not bad there are 9 lines of actual code
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ah, but only four of those are unique. That works out at 2 errors for each unique line of code
|
|
|
|
|
You missed a couple:
9) Undocumented
10) 100 numeric states. How do you keep track of which one does what...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Other than the missing semi-colon on the first statement, that's how it should be.
|
|
|
|
|
Well I have very good idea what happened. The programmer tried to implement fall-through switch, which is not allowed in C#. When he discovered that, he decided to work around it with those goto calls.
He was either rusty on his goto or he could not figure how to "declare" a label or maybe the language he was using before did allow something similar... That's what happens when you switch languages. For a while you keep thinking in terms of the old language thus producing such jems.
|
|
|
|