|
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?
|
|
|
|
|
Doug Goulden wrote: .NET to operate a heat recovery wheel?
No such luck - AFAIK, the controls guys all use Java. This is from a program used by sales people to design air-handling systems.
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?
|
|
|
|
|
Ahhh sales guys... they always get the good stuff. The company I work for decided to use Java for their programming applications and UI into the system. Someone should be flogged, keel hauled, or both for that decision.
Uptight Ex-Military Republican married to a Commie Lib - How weird is that?
|
|
|
|
|
I found something that made me blink with its absurdity the other day and what was more absurd was the defense the developer used when confronted with it.
while looking through countless strings storing SQL queries I noticed they were all written as so:
private static final String SQL = ""
+ " SELECT "
+ " nvl( vss.structure_address, "
+ " ifsapp.serial_structure_template_api.get_pos(top_part_no, "
etc...
When I asked him about the first empty string he looked at me as though I was suggesting replacing all hiss method calls with gotos "You can't just add a sting to nothing you know!" he snarled "you need an empty base"
|
|
|
|
|
TClarke wrote: private static final String SQL = ""
+ " SELECT "
+ " nvl( vss.structure_address, "
+ " ifsapp.serial_structure_template_api.get_pos(top_part_no,"
etc...
Without the "" on the first line, you couldn't start the second line with a +
hence the indentation might be at risk, i.e. the third and following lines might not
align with the second one; this may become very important when the code is worthwhile
and is likely be published on one or more forums.
BTW: the code itself is OK, the compiler does the concatenation for you.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
If it had just been down to him being a format obsessive I would have let it slide but he claimed it was not possible to start a string with a space unless you concatenated it to a blank string. Which is of course complete bollocks
Also this SQL was just going off to run in a database, it wouldn't be seen by anyone but developers on the team, none of which would be any less capable of reading the code if it wasn't aligned like that
Luc Pattyn wrote: BTW: the code itself is OK, the compiler does the concatenation for you.
Sure. The byte code comes out the same, he didn't know that though
|
|
|
|
|
Luc Pattyn wrote: the code itself is OK, the compiler does the concatenation for you.
But the string concatenation that has been used is pretty costly right?
|
|
|
|