|
vallarasus wrote: At least there should be a break point when it is met!!
So true. I've used something similar, but also kept the last 'hit' as it was more likely to be the next one. Another version I've see is a linked list and whenever a target is hit, it's moved to the top of the list.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
That's a joke However in this case there should be no iterator!!
|
|
|
|
|
This really takes the biscuit, just wrong on so many levels...
Private Function utilCheckSecurity(recSet As DAO.Recordset, userSet As DAO.Recordset, fileNo As String) As Integer
On Error GoTo errorCUS
If fileNo = "3" Then GoTo utilCSUpdate
If IsNull(recSet![SecurityClass]) Then GoTo utilCSUpdate
If Len(recSet![SecurityClass]) = 0 Then GoTo utilCSUpdate
If recSet![SecurityClass] Like userSet![updateclass] Then GoTo utilCSUpdate
If recSet![SecurityClass] Like userSet![readclass] Then GoTo UtilCSRead
utilCheckSecurity = 0
Exit Function
UtilCSRead:
utilCheckSecurity = 1
Exit Function
utilCSUpdate:
utilCheckSecurity = 2
Exit Function
errorCUS:
If Err = 3265 Then Resume utilCSUpdate
message "Error " & Format(Err, "######") & " " & Error, "UtilCheckSecurity"
Exit Function
End Function
|
|
|
|
|
It's VB6, so it's bound to stink. But that is a real piece of spaghetti goto numpty code.
I hope it was 'a co-worker' and not you who produced it.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Not really a co-worker, he'd left by the time I joined the company - its actually VBA, but you're on the right lines.
I wonder when Microsoft will get round to beefing up VBA in Office app's to a parity with .NET, if ever.
The same dev was fond of bad names too. So a function called "CheckXXX" may actually end up updating XXX. Consequently, I have to actually look at every damn function to see what its really doing by studying the code. I'm working on a bit no-ones touched for years but a bug has surfaced - its probably got lots there, but nobody wants to touch the code on a "if its not broke don't fix it", but we get miscelleaneous data errors which lead me to suspect it is broke.
I'm strongly considering moving on.
To me, even use of VB doesn't excuse that sort of coding. That was considered bad when "Goto considered harmful" was written, and I was 1 year old then!!!
When you can fit so many no-no's into such a short function, imagine what its like when you hit one of his 1000-liners. My head hurts.
|
|
|
|
|
' We fail
Oh yeah... they certainly did...
(yes|no|maybe)*
modified 22-Sep-11 13:58pm.
|
|
|
|
|
At least that comment was making sense
|
|
|
|
|
Pfft. That's nothing I'm currently 'fixing' an email service in c# that was somewhat similar except the person who coded it was doing logical checks before data checks. They were checking a from address (in a nice if tree) to determine how it fit into the system and then checking the content of the email (the same code used multiple times).
Then to top that off there were goto statements so after certain sections of testing was completed then move on to the next 'step'. This also has no comments, documentation, etc so I'm having a fun time refactoring it.
|
|
|
|
|
I just had an opportunity to review a code of a small software organization operating out of Virginia with a couple of offices in Chennai and New Delhi.
Two major 'gems' in their code was:
1) Inventing their own App_Code folder as XYZApp_Code
2) SqlConnection objects sitting in Session directly. Also a good bunch of their code directly refers the objects and opens it without evening checking for NULL.
The app simply failed against our framework which needed SessionState in SQLServer for web farm requirements and when this was coming up to a meeting with their so-called president/CEO, the elite guy responded 'Our products are unique business workflow designers in the market. They are not like the usual Microsoft asp.net websites. We need to make ConnectionObjects that **never** close at all throughout the life-cycle of the application'
What would you respond to this type of attitude?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
kthxbye?
Sorry for 'text speak'!
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood
|
|
|
|
|
Precisely. Why should we waste our time and energy on such jokers?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
You got to admit he's good at being a CEO. Who else could turn a blunder into a positive selling point.
"You get that on the big jobs."
|
|
|
|
|
I would bring this up as a potential threat to my business with the powers that be and try to find a different vendor for that type of product.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Here's a little jewel I found in the source code of a module I bought (just changed querystring parameter and variable names)
If Request.QueryString("queryParam") <> Nothing Then
Select Case Convert.ToInt16(Request.QueryString("queryParam"))
Case 1
var = 1
Case 2
var = 2
Case 3
var = 3
Case 4
var = 4
Case 5
var = 5
Case 6
var = 6
End Select
Else
Hopefully the possible values of the parameter won't grow in future
|
|
|
|
|
That's terrible. Where's the default value?
|
|
|
|
|
No, this is not terrible, it's good... it made me laugh!!
|
|
|
|
|
I saw something similar at <a href="http://www.rinkworks.com/stupid/cs_programming.shtml">Computer Stupidities</a> (about halfway down the page). This is worse, though, because one wouldn't expect such atrocities from professionals.
|
|
|
|
|
I'm consider myself far from being a gur at programming, but those things make me cry..
I still have to understand if it's sadness or joy!!
Thank's for the link
|
|
|
|
|
It's VB, what'd you expect?
V.
|
|
|
|
|
I might offend, I'm also a vb guy!!
At least, a I try to be as [C]sharp minded as possible
|
|
|
|
|
Alberto Biasiutti wrote: I'm also a vb guy
Maybe you don't have a choice, in that case you're forgiven as long as you keep that C# minded brain working
V.
|
|
|
|
|
Alberto Biasiutti wrote: I'm also a vb guy!!
We'll.
Speak.
Slowly.
Then.
I worked in VB for about 15 years and I am pleased to have escaped. For now.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Every time I come to CP, I feel dirty because I use VB!
I'll denounce you for discrimination!
|
|
|
|
|
Nagy Vilmos wrote: I worked in VB for about 15 years
That explains the lunchtime drinking...
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."
|
|
|
|
|
OriginalGriff wrote: That explains the lunchtime drinking.
No, that was the early part of career working in COBOL. VB is responsible for the night time drinking.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|