Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions for custom methods?
Message
 
 
To
18/11/2008 13:59:50
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01362229
Message ID:
01362649
Views:
33
>>IMO, strong typing has nothing to do with compile speed. It has everything to do with catching errors at compile time that you normally wouldn't catch until runtime.
>>
>>If you don't want to declare every variable in .Net, then just make everything var (although it isn't recommended) or turn it off in VB.
>>
>>No need to scroll up either. Most .Net people just define the variable when it's first used.
>
>IOW, they have already adjusted their hands to the handle of the new hammer.
>
>Oh, you mean inline? Variable x is first used on line 55, so it's declared on line 54? So then when you meet it on line 233, you need to scroll back to see its declaration, and can't scroll to the top because declarations are scattered around the code? And what if there's a need for that variable earlier in the code, so a new line mentioning it at line 33 is inserted, and it's not declared until line 55 (line previously known as 54), what happens then? I guess compile error, find the declaration, move it up. Not that I think that any piece of code should be longer than 50 lines to start with, but it happens.
>
>IMO, one neat thing about the variable declarations is that they're grouped on top, just like they once were in single-pass compilers, so when you need one you know where to look. You may scatter them throughout the code, but that decreases readability, IMO, and then you at least have to search up and down. Well, the more you read the code, the better you know it...

What Craig meant is you can declare and initialize a variable in one statement, like so:

string returnMessage = "";

(As opposed to

string returnMessage;
returnMessage = "";

)

Now here is one you may like. If you are wondering about a variable's declaration, hover the mouse over it, right click, and choose Go To Definition. Doesn't matter how near or far away it is in the source code. Not bad?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform