|
The verbosity does help as long as everything is properly indented. When it is not, VC6 (dunno about VC7) has Ctrl + ] to pinpoint matching braces.
Is there something similar for VB?
Regards,
Alvaro
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein
|
|
|
|
|
Yup, VC7 has Ctrl+] to jump to other brace... and even better Ctrl+Shift+] to highlight everything between the two braces.
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Chris Maunder wrote:
But the ridiculous AndAlso, OrElse and Dim keyowrds?
So is AndAlso and OrElse new keywords in VB.Net, because I have never heard of them before?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
These are the new short-circuit versions of the And/Or operators.
cheers,
Chris Maunder
|
|
|
|
|
Chris Maunder wrote:
I actually like this. It's so much harder to mismatch end braces. It's easy to trace code backwards and see where the while loop ends. Overall this particular piece of verbosity is nice.
Except that statement has been rendered obsolete becuase of VC7's editor features that make it easy to show which braces match up.
You can pick your friends, and you can pick your nose, but you can't pick your friend's nose.
|
|
|
|
|
And even before that, Visual Assist did the same for you in VC6.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Chris Maunder wrote:
It's so much harder to mismatch end braces.
This is only a problem for K&R style braces {
which look like this.
}
That style is, of course, utterly gay, and it's almost impossible to mismatch braces
{
when you write them like this
{
and make sure your code is properly indented
{
which is hard to do in this environment, but VS does it for you for free
}
}
}
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Christian Graus wrote:
This is only a problem for K&R style braces
Rubbish.
If you have a long function which extends below the screen (and let's not even go into that particular debate) then when you are looking at the bottom of the function without the top as a reference it can sometimes take a few seconds to sort out which brace closes which statement. For the sake of this argument let's assume it's code you aren't 100% familiar with.
I'm not saying it's difficult by any stretch of the imagination, I'mjust saying 'End If' and 'WEnd' making it brain dead simple. Kinda like VB programmers (oops - did I say that? )
cheers,
Chris Maunder
|
|
|
|
|
Chris Maunder wrote:
If you have a long function which extends below the screen (and let's not even go into that particular debate) then when you are looking at the bottom of the function without the top as a reference it can sometimes take a few seconds to sort out which brace closes which statement. For the sake of this argument let's assume it's code you aren't 100% familiar with.
First of all, VC gives you keys to jump between start and end in order to see what the scope is, secondly, how does the syntax matter if the problem is that you can't see all the code at the same time anyhow ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
So what if you are using Notepad or reading a printout?
It's a matter of taste. I'm not saying and 'End If' makes me complete, or that curly braces are difficult. I'm saying that in some situations they provide more information than a curly bracket.
cheers,
Chris Maunder
|
|
|
|
|
Chris Maunder wrote:
So what if you are using Notepad or reading a printout?
Then I don't see the difference.
Chris Maunder wrote:
I'm not saying and 'End If' makes me complete, or that curly braces are difficult.
I realise you were not saying you *needed* the VB syntax, or that you disliked the C++ one especially, I just fail to see the difference.
Chris Maunder wrote:
It's a matter of taste.
Obviously so.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
|
|
|
|
|
Chris Maunder wrote:
It's so much harder to mismatch end braces
But you know about the Ctrl-E keycombination?
Why should the poor human that I am do such a typical computers job?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Ctrl-E doesn't work in notepad
cheers,
Chris Maunder
|
|
|
|
|
So don't write code in notepad, at least get SciTE or something.
In fact, VB will be worse off in notepad, since 1. it's a lot easier to mistype the sentence fragments that it requires than braces, and 2. it's just as hard to match the beginnings and endings of blocks, in fact with proper indentation, C is probably better because you only have to read a single symbol.
This is a pretty shallow thing to complain about anyway, I mean it doesn't really affect program structure or code speed. It's just a matter of memorizing one method and working with it.
(sorry, I'm too lazy to log on)
|
|
|
|
|
Anonymous wrote:
This is a pretty shallow thing to complain about anyway
OK - let's go way back in time to the beginning of this thread:
<wavy dream sequence>
I was about to complain about the VB syntax and how you have to end an if statement with End If, and a subroutine with End Sub.
Allow me to backflip in the middle of a post.
I actually like this. It's so much harder to mismatch end braces.
There's absolutely nothing wrong with C curly braces. They are one of God's little creatures and thus are Good. It's just that I was about to bag out VB syntax and then realised that I didn't actually hate it as much as I thought. Maybe I need to attend VB anonymous.
"Hi, my name is Chris and I write VBScript"
cheers,
Chris Maunder
|
|
|
|
|
I can't tell you how many times I have been looking through a developers C++ code and seen this way at the end of a group of nested statements:
}
}
}
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Unknown wrote:
"I love long walks, especialy taken by those that annoy me."
|
|
|
|
|
BASIC was since the beginning a lot easier to start with then C++, but C++ is more powerfull. So is VB.NET easier to start with, but C# will be more powerfull when you want something special.
Still I think that VB is just as good as C# with or without the weird braces and curly thingies
I hope they will keep this language in the future
|
|
|
|
|
The mighty-thewed C++ programmer disdainfully whacked the backside of the sniveling VB user at his feet with his broadsword.
"Get on ye," he growled, "methinks thy blood isn't fit to foul my blade."
Software Zen: delete this;
|
|
|
|
|
sssh. There are VB programmers here in our office
"delete this", I used this once on a thread class that deletes itself after its thread function terminates.
|
|
|
|
|
Uh, Stormwind, you say you've actually used "delete this;" in your code once. Could you send me that code please? I'd like to have a look at it. I can guarantee you that I won't give it anywhere else, if that makes you feel better.
Please mail your reply to binarybandit@operamail.com .
Regards,
Vikram.
Do not put off until runtime what you can do at compile-time.
|
|
|
|
|
Anyone's who's ever had to write a COM server in C++ from scratch will undoubtedly have used "delete this". It's how COM objects self destruct when Release reaches a ref-count of 0. Just remember not to access any of the class's member variables afterwards, or boom!
Regards,
Alvaro
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing. -- Albert Einstein
|
|
|
|
|
Alvaro Mendez wrote:
Anyone's who's ever had to write a COM server in C++ from scratch will undoubtedly have used "delete this".
Whoa ! I'm a just 19-year old student. I'm quite strong in C and C++, but as far as Win32 SDK and MFC are concerned, I consider myself a novice.
Alvaro Mendez wrote:
Just remember not to access any of the class's member variables afterwards, or boom!
That part I can understand.
About that code of yours ...
Regards and thanks,
Vikram.
Do not put off until runtime what you can do at compile-time.
|
|
|
|
|
I've used this in my in-place editors inside my grid control. Works like a dream.
cheers,
Chris Maunder
|
|
|
|
|
Thanks, Chris!
I'm checking out your article right now.
Regards,
Vikram.
Do not put off until runtime what you can do at compile-time.
|
|
|
|
|
I occasionally use VB, either because i need to prototype a GUI quickly, or because i need to write some ASP(not net) code. Although many things about the language anger and frustrate me, i can't deny it does what it aims to do - you can throw together programs quickly, and with few critical problems. Sure, they'll then be difficult to maintain, extend, or reuse effectively, but hey - that wasn't the point. If you take the time, you *can* write maintainable, extensible, reusable VB code, but then again, you can hammer in nails with your fist too if that's your thing.
Now, VB.NET has revamped some major portions of the language, and i could actually see a nicely planned and designed piece of software being fairly painless to write in it, while still not being sh*t two years (or heck, 6 months...) later.
But, so what? So does C++, so does Java, so does C#, so does... you get my point - if this is what you wanted, you already had it, sans VB. No doubt there are one or two hardcore souls out there who have been doing serious programming with VB for years, and who'll embrace VB.NET with open arms and dewy eyes... But for the "throw the controls on the form, double-click, type in all code in event handler" user, what does VB.NET add, beyond an annoying conversion and a new development environment?
My prediction: 5 years from now, VB6 will still be used for older code, VB.NET will be used for newer code, but used in the same careless way VB6 was. The serious VBers will have gradually moved to C# (cursing semicolons all the way no doubt), and will probably be happer for it, though asserting all that is good in C# came from VB.
I'll be sitting and drinking gin someplace, and wondering why i ever cared...
shog
nine
Ever since i heard the voice
i thought i had no choice...
|
|
|
|
|