Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which Is More Readable To You?
Message
From
06/03/2008 15:38:52
 
 
To
06/03/2008 15:17:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01298471
Message ID:
01299507
Views:
19
>>>>>>>I find the latter easier to read, but from experience I know it's harder to maintain, for the reasons Craig and Dorris have already outlined. I "view" it as being pretty, but fragile.
>>>>>>>
>>>>>>>I believe questions like this should be moot - the IDE should be configurable to show you the code the way you want to see it. It should have 2 modes: "real" mode, which shows you exactly what's in the source file, and "pretty" mode, which would make it more readable according to your personal preferences. Ideally modes could be switched quickly with a hot key etc.
>>>>>>>
>>>>>>>The idea would be similar to applying different CSSs to a Web page.
>>>>>>>
>>>>>>>Now that the VFP language is "stable" something like this could conceivably be built :)
>>>>>>>
>>>>>>>For comparison, my impression is the VS IDE is fairly rigid in its conventions for indentation and whitespace, from the very limited amount I've used it and seen it demo'd. Maybe I just never bothered to look for any customizations. Overall its code editor's better than VFP's, however.
>>>>>>
>>>>>>I think your impression is wrong. You should take a look at the options in the Text Editor settings (including the language specific ones) - it's hard to think of any options that *aren't* available <g>
>>>>>>
>>>>>>>I attended the HHH launch event today here in Vancouver and the code editing demos (in VS 2008) still looked pretty rigid in formatting. It would seem that MS's preference is for less flexibility and personalization, rather than more.
>>>>>
>>>>>I don't have VS2005 or 2008 installed, but I did a search on MSDN and came up with http://msdn2.microsoft.com/en-us/library/03864tbz.aspx
>>>>>
>>>>>It looks like the "biggie" wrt formatting is enabling or disabling automatic formatting of completed statements or blocks. I suppose if you turn this off you can do whatever you want. My guess is that it's turned on by default, and if so you get what MS thinks is best.
>>>>>
>>>>>I was thinking more along the lines of the sort of readability "discussions" threads we've seen here over the past while. Personally I'd like to be able to specify things like:
>>>>>
>>>>>- Clause alignment as the OP illustrated in this thread
>>>>>- White space in parentheses e.g. ( parameter ) vs. (parameter)
>>>>>- White space around operators e.g. x = y + z vs. x=y+z
>>>>>- Multiple parameters on multiple lines, with leading or trailing commas e.g.
>>>>>
>>>>>SELECT ;
>>>>>  Col1 ;
>>>>>  , Col2 ;
>>>>>  ...
>>>>>
>>>>>vs.
>>>>>
>>>>>SELECT ;
>>>>>  Col1, ;
>>>>>  Col2, ;
>>>>>  ...
>>>>>
>>>>>- Whitespace prior to continuation character e.g.
>>>>>Statement ;
>>>>>vs.
>>>>>Statement;
>>>>>
>>>>>- The list goes on and on ...
>>>>>
>>>>>We all have our own preferences for these little things. Correct me if I'm wrong, but I didn't see anything like this in the VS text editor options, at least in the MSDN docs.
>>>>
>>>>I think you're wrong. In C# I'm pretty sure there are white space options for all of the things you've mentioned (well over twenty seperate options on spacing alone - plus about the same number again dealing with indentation and new line options). Howver VB users are not so well catered for.
>>>
>>>That's cool! Would you happen to have a link that shows these options? I'm interested to see what MS offers and/or considers significant.
>>
>>I guess that the starting point is here:http://msdn2.microsoft.com/en-us/library/ms165323.aspx but, based on a quick look, it doesn't seem to cover most of the options that are actually available ....
>
>Yeah, I got that far - that's how I got the link I posted above, but like you say it doesn't show detailed options, even in the language-specific sections. I wish there were some screen caps available somewhere.

OK. Until I get bored with typing <g> the Spacing options alone for C# are:

Set Spacing for method declarations:
Insert space between method name and its opening parenthesis
Insert space within argument list parenthesis
Insert space within empty argument list parenthesis
Set Spacing for method calls:
Insert space between method name and its opening parenthesis
Insert space within argument list parenthesis
Insert space within empty argument list parenthesis
Set other spacing options:
Insert space after keywords in control flow statements
Insert space within parenthesis of expressions
Insert space within parenthesis of type casts
Insert space inside parenthesis for control flow statements
Insert space after cast
Set spacing for brackets:
Insert space before open square brackets
Insert space within empty square brackets
Insert space within square brackets
Set spacing for delimiters
Insert space after colon for base or interface in type declaration
Insert space after comma
Insert space after dot
Insert space after semicolon in 'for' statement
Insert space before colon for base or interface in type declaration
Insert space before comma
Insert space before comma
Insert space before dot
Insert space before semicolon in "for" statement
Set spacing for operators: (radio buttons)
Insert space before and after binary operators
Ignore spaces around binary operators
Remove spaces before and after binary operators

etc, etc
Have your eyes glazed over yet :-}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform