|
there's one in the setter too.
|
|
|
|
|
I strongly suspect that nugget of joy was written by someone who typically writes in JavaScript.
Or maybe a cat walking across the keyboard.
Any other answer would be insane...
|
|
|
|
|
Or someone who has no idea what he is doing and is playing games in class and not paying attention to the professor.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I think this just speaks for itself...
(I apologise in advance for the pain caused)
How many bad practices can y'all spot in this?
Function InvokeMember(MethodName As String, _
Optional ByRef P1 As Object = "!%$", Optional ByRef P2 As Object = "!%$", _
Optional ByRef P3 As Object = "!%$", Optional ByRef P4 As Object = "!%$", _
Optional ByRef P5 As Object = "!%$", Optional ByRef P6 As Object = "!%$", _
Optional ByRef P7 As Object = "!%$", Optional ByRef P8 As Object = "!%$", _
Optional ByRef P9 As Object = "!%$", Optional ByRef P10 As Object = "!%$", _
Optional ByRef P11 As Object = "!%$") As Object
Dim Parms(0) As Object
If P1.GetType Is GetType(String) Then If P1 = "!%$" Then GoTo a150
Parms(0) = P1
If P2.GetType Is GetType(String) Then If P2 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P2
If P3.GetType Is GetType(String) Then If P3 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P3
If P4.GetType Is GetType(String) Then If P4 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P4
If P5.GetType Is GetType(String) Then If P5 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P5
If P6.GetType Is GetType(String) Then If P6 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P6
If P7.GetType Is GetType(String) Then If P7 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P7
If P8.GetType Is GetType(String) Then If P8 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P8
If P9.GetType Is GetType(String) Then If P9 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P9
If P10.GetType Is GetType(String) Then If P10 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P10
If P11.GetType Is GetType(String) Then If P11 = "!%$" Then GoTo a100
ReDim Preserve Parms(UBound(Parms) + 1) : Parms(UBound(Parms)) = P11
a100:
On Error GoTo a200
InvokeMember = DLLClass.InvokeMember(MethodName, _
Reflection.BindingFlags.InvokeMethod, Nothing, DLlInstance, Parms, Nothing)
Dim x As Integer
For x = 0 To UBound(Parms)
If x = 0 Then P1 = Parms(x)
If x = 1 Then P2 = Parms(x)
If x = 2 Then P3 = Parms(x)
If x = 3 Then P4 = Parms(x)
If x = 4 Then P5 = Parms(x)
If x = 5 Then P6 = Parms(x)
If x = 6 Then P7 = Parms(x)
If x = 7 Then P8 = Parms(x)
If x = 8 Then P9 = Parms(x)
If x = 9 Then P10 = Parms(x)
If x = 10 Then P11 = Parms(x)
Next
Exit Function
a150:
On Error GoTo a200
InvokeMember = DLLClass.InvokeMember(MethodName, _
Reflection.BindingFlags.InvokeMethod, Nothing, DLlInstance, Nothing, Nothing)
Exit Function
a200:
Dim m As String = ""
m = m & "Error invoking Method: " & MethodName & vbCrLf
m = m & "Either the Method Name is incorrect (Check Case Sensitivity)" & vbCrLf
m = m & "Or The Parameter sequence does not match the Methods signature"
InvokeExitSystem(m)
End Function
(PS - this is actually VB.NET code).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I gave up counting them after reading optional byref p2 as object
just luckily its the practically weekend at 5:30 today (long live the long weekend )
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Luckily I've got two weeks vacation - I think I need it. My eyes are bleeding.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
My needs for daily wtf are covered.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
WTF? Whoever wrote that needs to be strung up by his pinky fingers!
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Sadly, its 3rd party code I have to interface to.
It kinda works, but !
(At least it works 'til it fails horribly, when someone calls a function with one too many parameters, when it fail ungracefully)
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Have somea lot of .
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Oh, and the person who created this needs to be bashed over the head with a solid iron clue bat. Several times.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Rob Grainger wrote: How many bad practices can y'all spot in this?
....
(PS - this is actually VB.NET code).
Kind of you to start the list for us. 
|
|
|
|
|
I had to highlight that - at a casual glance it looks just like VB6 code, which is a WTF in itself.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I was just about to comment that is looks more as VB6 then VB.NET
It is a terrible, terrible mess of VB6 programmer(s) trying to cross over
|
|
|
|
|
But why would you want to do something like that?
|
|
|
|
|
Rob Grainger wrote: (PS - this is actually VB.NET code). It's a disgrace, and that's language agnostic (which is pretty hip by the way)
|
|
|
|
|
Sander Rossel wrote: It's a disgrace, and that's language agnostic (which is pretty hip by the way)
I'm trying real hard to take it to the next level and be language atheist, but its not working out to well so far.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I love VB.NET and I love C#.
I'm trying to love JavaScript, but it just gives me so much reasons to hate it...
I really hate HTML and CSS and I'm past the points where I'd like to like it. They're not programming languages anyway.
Each language you know makes learning another language easier.
Try to look past the language specific part and see how your knowledge about some language can be applied to other languages
|
|
|
|
|
"Each language you know makes learning another language easier."
Don't know, after a point if you keep learning similar (read imperative, OO) languages you reach a point where you pick up another one quickly, but you'll still have a certain time. Normally its libraries/frameworks which take most time. Especially for JavaScript where there seems to a new framework every day.
To really push yourself step outside the comfort zone. Try a functional language (A LISP variant and Haskell are particular good for going outside the comfort zone). Try a real OO language like Smalltalk. That kind of difference changes the whole way you think about programming.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Even the JavaScript frameworks look similar after a while. Once you know what they do it's relatively easy to find how they do it. Usually there are some HTML bindings, some viewModel thingy, etc.
I know C#, VB(.NET), SQL, JavaScript, HTML, CSS, LESS, some Haskell, F#, and Java, and I've read other languages like Lisp, Ada, C, C++, and Cobol.
I should try a non-managed language some time, and I mean really working with it.
Learning new languages can be fun, it's just a little useless if you can't really use it in day to day life
Although learning Haskell and F# did make me a better C# programmer.
|
|
|
|
|
Yuck! That reads like FORTRAN 66 was the author's first programming language.
__________________
Lord, grant me the serenity to accept that there are some things I just can’t keep up with, the determination to keep up with the things I must keep up with, and the wisdom to find a good RSS feed from someone who keeps up with what I’d like to, but just don’t have the damn bandwidth to handle right now.
© 2009, Rex Hammock
|
|
|
|
|
"'Raise<ActualName>Event' ... Why do you use such a strange name for an event?"
"I follow Microsoft Guidelines. They use such naming. I found it on their website."
"If you happen to find that page again, please send me a link."
Joseph did not hesitate. He opened Google, entered some search terms, looked at some results.
"Here it is: How to: Publish Events that Conform to .NET Framework Guidelines (C# Programming Guide)[^]".
And really, that's what Microsoft did in that article:
Microsoft wrote:
public event EventHandler<CustomEventArgs> RaiseCustomEvent; And then Joseph thought that's how events ought to be named: start with "Raise", add the actual name, then add "Event"...
Thank you, Microsoft.
|
|
|
|
|
Let's hope he never looks into the .NET source or else he might come up with many more fantastic MS naming "conventions"
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
How does he name his classes and methods?
Show him this[^].
modified 22-Mar-16 2:12am.
|
|
|
|
|
Jörgen Andersson wrote: Show him this[^].
The one that says
Server Error in '/' Application.
would it be?
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|