|
John Simmons / outlaw programmer wrote: Any assembly language is a coding horror
Awww, come on :->
John Simmons / outlaw programmer wrote: any flavor of VB you might happen to mention
Yep...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I suppose
ON x GOSUB sub1, sub2, sub3
is worse.
|
|
|
|
|
Don't remind me THAT... Please?
Greetings - Gajatko
|
|
|
|
|
Well I don't know if anyone has seen this horror in Visual Basic 6.0 code.
One of my colleague was doing his assignment. Now say there are three functions Function1 , Function2 , Function3 . Function1 is calling Function2 .
But instead of going to Function2 it goes to Function3 . Now I've seen this my own eyes .
We did try keeping a breakpoint at the call of Function2 from Function1 . When this breakpoint is hit and I tried debugging it through F8 key. And I could not believe my eyes. It was going into Function3 .
Well after some trial and errors, I changed the function definition of Function3 from Public to Private and guess what??? It worked . Now the code works fine. Any idea why this was happening? Has anybody seen this before?
|
|
|
|
|
Surprisingly, compilers have bugs too.
Have you installed Service Pack 6?
|
|
|
|
|
Yes! I have isntalled SP6...
|
|
|
|
|
Mike Dimmick wrote: compilers have bugs too
And to fuel it, it is Visual Basic 6 .
|
|
|
|
|
I think that the coding horror here is that you are still using VB6.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
;PIf you read my message carefully it's not me who is using VB. It's my colleague.
|
|
|
|
|
Nilesh Hapse wrote: If you read my message carefully it's not me who is using VB. It's my colleague.
That's what they all say.
"Officer, I wasn't coding in VB6. It was my, errrm, friend."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: That's what they all say.
PosterDeclaration objPosterDeclaration = (Friend_Told_Me_Or_Friend_Used_It) I_Used_It();
|
|
|
|
|
I'd change the variable name to "lie", but otherwise the code is fine...
|
|
|
|
|
|
I'm not! I'm using VB.NET and C#
|
|
|
|
|
There may be a question of scope - your colleague may have inadvertently named Function2 with a global so that if you had:
Function1()
Function2()
Function3()
and did not have debugging libraries installed, the code for Function2 (the wrong Function2 in this case) would execute and the debugger would step into Function3.
The sequence would be:
begin Function1
execute code (possibly under debugger)
end Function1
begin and execute WrongFunction2 (debugger can't enter the code so it executes WrongFunction2)
begin Function3
execute code
end function
|
|
|
|
|
Can you provide some code that exhibits the behaviour?
|
|
|
|
|
Please post the code so we can explain why it's user error and not a problem with the compiler. I have a feeling there's a true Coding Horror lying in wait for us.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Try
#define public private
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Ok, so it was pretty bad. Hard-coded values, obsolete techniques, as dirty as quick'n'dirty can be...
But did VS really need to puke all over it?[^]
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
I've seen that before. There's nothing special about the VS code highlighting software. IMO you need Visual Assist if you care about aesthetics and ease of use in VS.
|
|
|
|
|
I've had that too - especially in aspx pages.
Although I also love the thing where you paste something into a tag while VS is in the middle of trying to be clever with intellisense and suddenly your pasted text is catapulted to the other end of the line.
oopsie!
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Or when you want to do <% %>, and it puts the > somewhere in the middle of a line of code...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
Wow... psychedelic almost. That was a fun read
-Gatsby
|
|
|
|
|
.NET to operate a heat recovery wheel? Cool. Can I ask what you were writing it for? My experience most control contractors use propriatary "languages".
Uptight Ex-Military Republican married to a Commie Lib - How weird is that?
|
|
|
|