Wish List: Embedded Quotes in VB.Net 
Author Message
 Wish List: Embedded Quotes in VB.Net

A lot of the time we have to embed quotes in a string. Example

Response.Write " <a href=""" & sURL & """>"

Two things I would like to see.

1) When I set color of Strings in the IDE, both the embedded quotes and the
outside ones change color. I don't think the outer ones should, as it
reduces readability.

2)  When I write "", I would like the IDE to display it as a single
character, maybe a bold ". That way, I know that is has been properly
escaped.

I think this could be extended to other languages as well. SQL needs '' to
escape single quotes, and C#/JScript have a whole host of escape sequences.

--
Jonathan Allen



Mon, 16 Jun 2003 09:46:37 GMT  
 Wish List: Embedded Quotes in VB.Net
Yeah, I agree, that'd be really nice.

Peter


Quote:
> A lot of the time we have to embed quotes in a string. Example

> Response.Write " <a href=""" & sURL & """>"

> Two things I would like to see.

> 1) When I set color of Strings in the IDE, both the embedded quotes and
the
> outside ones change color. I don't think the outer ones should, as it
> reduces readability.

> 2)  When I write "", I would like the IDE to display it as a single
> character, maybe a bold ". That way, I know that is has been properly
> escaped.

> I think this could be extended to other languages as well. SQL needs '' to
> escape single quotes, and C#/JScript have a whole host of escape
sequences.

> --
> Jonathan Allen



Mon, 16 Jun 2003 16:24:27 GMT  
 Wish List: Embedded Quotes in VB.Net


Quote:
> A lot of the time we have to embed quotes in a string. Example

> Response.Write " <a href=""" & sURL & """>"

> Two things I would like to see.

> 1) When I set color of Strings in the IDE, both the embedded quotes and
the
> outside ones change color. I don't think the outer ones should, as it
> reduces readability.

> 2)  When I write "", I would like the IDE to display it as a single
> character, maybe a bold ". That way, I know that is has been properly
> escaped.

> I think this could be extended to other languages as well. SQL needs '' to
> escape single quotes, and C#/JScript have a whole host of escape

sequences.

I'm not sure. What about new users who maybe due to this would not be able
to write code outside the IDE at all (simply not understanding what's really
going on)?

/Carl



Mon, 16 Jun 2003 19:01:51 GMT  
 Wish List: Embedded Quotes in VB.Net
Hi Carl,



Quote:

> I'm not sure. What about new users who maybe due to this would not be able
> to write code outside the IDE at all (simply not understanding what's
really
> going on)?

Yeh, I agree. I don't think the """" is very readable no matter how you bold
it. If you bold the internal "" 's then it looks like "" will be printed
out, whereas only " will. If you bold only one of them, it makes the outer
number unbalanced.

I think a far better design to use the Microsoft.VisualBasic.ControlChars or
define your own constants. eg:
Response.Write " <a href=" & quote & sURL & quote & ">"
is more readable than
Response.Write " <a href=""" & sURL & """>"



Mon, 16 Jun 2003 19:29:21 GMT  
 Wish List: Embedded Quotes in VB.Net
I've always vbNewLine and vbCrLf in my ASP, as I've previously used Notepad
for all my stuff and it certainly is more readable than when you start
having three quotes in a row. I think it would be nice to have the option of
displaying double or triple quotes or whatever using bolds as Jonathan
suggested, if not by default, then at least having an option somewhere in
VS.

Peter


Quote:
> Hi Carl,



> > I'm not sure. What about new users who maybe due to this would not be
able
> > to write code outside the IDE at all (simply not understanding what's
> really
> > going on)?

> Yeh, I agree. I don't think the """" is very readable no matter how you
bold
> it. If you bold the internal "" 's then it looks like "" will be printed
> out, whereas only " will. If you bold only one of them, it makes the outer
> number unbalanced.

> I think a far better design to use the Microsoft.VisualBasic.ControlChars
or
> define your own constants. eg:
> Response.Write " <a href=" & quote & sURL & quote & ">"
> is more readable than
> Response.Write " <a href=""" & sURL & """>"



Mon, 16 Jun 2003 20:24:36 GMT  
 Wish List: Embedded Quotes in VB.Net

Hi Peter,

excuse the html format of this post, but I just want to make this clear. In
VB,
"""" is a single quote ( " )
So do you have :
(i) """"  (yes that's bolded "" inside " " using Courier New !!)
(ii) """" (or some other color. Does the red imply one or two quotes ??)
(iii) """" (just one quote colored (or bolded <bg>) Now the outside "'s
don't match.

So as you can see, (i) bolding does NOT work for Courier New, which is the
standard text editor font (and please don't suggest using Times New Roman or
Arial <g>), and
(ii) & (iii) a new ambiguity is introduced.  Using NewLine, Quote etc is
clearer and is IMO the best practice to adopt.

BTW: I don't want the IDE having anymore to parse than is useful, so I can
see no value in his suggestion, just cost.


Quote:
> I've always vbNewLine and vbCrLf in my ASP, as I've previously used
Notepad
> for all my stuff and it certainly is more readable than when you start
> having three quotes in a row. I think it would be nice to have the option
of
> displaying double or triple quotes or whatever using bolds as Jonathan
> suggested, if not by default, then at least having an option somewhere in
> VS.



Mon, 16 Jun 2003 20:25:17 GMT  
 Wish List: Embedded Quotes in VB.Net

Whoops, I'll try that again. Looks like the font encoding didn't go with the
message before:

So do you have :
(i) """"  (yes that's bolded "" inside " " using Courier New !!)
(ii) """" (or some other color. Does the red imply one or two quotes ??)
(iii)""""  (just one quote colored (or bolded <bg>) Now the outside "'s
don't match

.....


Quote:
> Hi Peter,

> excuse the html format of this post, but I just want to make this clear.
In
> VB,
> """" is a single quote ( " )
> So do you have :
> (i) """"  (yes that's bolded "" inside " " using Courier New !!)
> (ii) """" (or some other color. Does the red imply one or two quotes ??)
> (iii) """" (just one quote colored (or bolded <bg>) Now the outside "'s
> don't match.

> So as you can see, (i) bolding does NOT work for Courier New, which is the
> standard text editor font (and please don't suggest using Times New Roman
or
> Arial <g>), and
> (ii) & (iii) a new ambiguity is introduced.  Using NewLine, Quote etc is
> clearer and is IMO the best practice to adopt.



Mon, 16 Jun 2003 20:48:05 GMT  
 Wish List: Embedded Quotes in VB.Net
I agree!

How about escapes like java :

    Dim s as string

    s = "My name is \"Paul\""

Regards,
\"Paul Speranza\"


Quote:
> A lot of the time we have to embed quotes in a string. Example

> Response.Write " <a href=""" & sURL & """>"

> Two things I would like to see.

> 1) When I set color of Strings in the IDE, both the embedded quotes and
the
> outside ones change color. I don't think the outer ones should, as it
> reduces readability.

> 2)  When I write "", I would like the IDE to display it as a single
> character, maybe a bold ". That way, I know that is has been properly
> escaped.

> I think this could be extended to other languages as well. SQL needs '' to
> escape single quotes, and C#/JScript have a whole host of escape
sequences.

> --
> Jonathan Allen



Mon, 16 Jun 2003 22:24:33 GMT  
 Wish List: Embedded Quotes in VB.Net

Quote:
> Yeh, I agree. I don't think the """" is very readable no matter how you
bold
> it. If you bold the internal "" 's then it looks like "" will be printed
> out, whereas only " will. If you bold only one of them, it makes the outer
> number unbalanced.

> I think a far better design to use the Microsoft.VisualBasic.ControlChars
or
> define your own constants. eg:
> Response.Write " <a href=" & quote & sURL & quote & ">"
> is more readable than
> Response.Write " <a href=""" & sURL & """>"

Along that line, I always thought the simplest solution would have been for
MS to simply include a predefined constant for quotes, OR allow us to use
CHR$( in a constant declaration i.e.

Const vbQuote = Chr$(34)

--

Bill Hileman, Programmer/Analyst, DASI

Language Comparison: http://www.boneville.net/programming/default.htm

PROGRAM n. A magic spell cast over a computer allowing it to turn one's
input into error messages. tr.v. To engage in a pastime similar to banging
one's head against a wall, but with fewer opportunities for reward.



Mon, 16 Jun 2003 22:41:10 GMT  
 Wish List: Embedded Quotes in VB.Net
Sorry, I was just looking at the post and thought, "What was I saying?!?".
When I said vbNewLine and vbCrLf, I meant Chr(34)


Quote:
> I've always vbNewLine and vbCrLf in my ASP, as I've previously used
Notepad
> for all my stuff and it certainly is more readable than when you start
> having three quotes in a row. I think it would be nice to have the option
of
> displaying double or triple quotes or whatever using bolds as Jonathan
> suggested, if not by default, then at least having an option somewhere in
> VS.

> Peter



> > Hi Carl,



> > > I'm not sure. What about new users who maybe due to this would not be
> able
> > > to write code outside the IDE at all (simply not understanding what's
> > really
> > > going on)?

> > Yeh, I agree. I don't think the """" is very readable no matter how you
> bold
> > it. If you bold the internal "" 's then it looks like "" will be printed
> > out, whereas only " will. If you bold only one of them, it makes the
outer
> > number unbalanced.

> > I think a far better design to use the

Microsoft.VisualBasic.ControlChars

- Show quoted text -

Quote:
> or
> > define your own constants. eg:
> > Response.Write " <a href=" & quote & sURL & quote & ">"
> > is more readable than
> > Response.Write " <a href=""" & sURL & """>"



Tue, 17 Jun 2003 01:29:14 GMT  
 Wish List: Embedded Quotes in VB.Net

Quote:
> Yeh, I agree. I don't think the """" is very readable no matter how you
bold
> it. If you bold the internal "" 's then it looks like "" will be printed
> out, whereas only " will. If you bold only one of them, it makes the outer
> number unbalanced.

The idea is that """" will be displayed as """ with the center one bolded (or a different color like you showed).
That is, the two quotation marks become a single bold quotation mark.

--
Jonathan Allen


Quote:
> Hi Carl,



> > I'm not sure. What about new users who maybe due to this would not be
able
> > to write code outside the IDE at all (simply not understanding what's
> really
> > going on)?

> Yeh, I agree. I don't think the """" is very readable no matter how you
bold
> it. If you bold the internal "" 's then it looks like "" will be printed
> out, whereas only " will. If you bold only one of them, it makes the outer
> number unbalanced.

> I think a far better design to use the Microsoft.VisualBasic.ControlChars
or
> define your own constants. eg:
> Response.Write " <a href=" & quote & sURL & quote & ">"
> is more readable than
> Response.Write " <a href=""" & sURL & """>"



Tue, 17 Jun 2003 02:30:01 GMT  
 Wish List: Embedded Quotes in VB.Net


Quote:
>> Yeh, I agree. I don't think the """" is very readable no matter how you
bold
>> it. If you bold the internal "" 's then it looks like "" will be printed
>> out, whereas only " will. If you bold only one of them, it makes the
outer
>> number unbalanced.

>The idea is that """" will be displayed as """ with the center one bolded

(or a different color like you showed).

Quote:
>That is, the two quotation marks become a single bold quotation mark.

I dislike condensing the doubled quote to a single quote as it would make
printed code difficult to interpret unless a color printer was used or would
require that printed code be different than the screen code.

Currently you can configure the colors used for strings -- if that setting
either did not apply to the enclosing quotes or if a separate color setting
was available for string delimiters then people who want to see the embedded
quotes in a different color could do so and people who wanted it like it is
now could configure it that way.



Tue, 17 Jun 2003 04:05:38 GMT  
 Wish List: Embedded Quotes in VB.Net

Quote:
> I dislike condensing the doubled quote to a single quote as it would make
> printed code difficult to interpret unless a color printer was used or
would
> require that printed code be different than the screen code.

I suppose it would be turned off for hard copies, just like colors are.

--
Jonathan Allen


Quote:



> >> Yeh, I agree. I don't think the """" is very readable no matter how you
> bold
> >> it. If you bold the internal "" 's then it looks like "" will be
printed
> >> out, whereas only " will. If you bold only one of them, it makes the
> outer
> >> number unbalanced.

> >The idea is that """" will be displayed as """ with the center one bolded
> (or a different color like you showed).
> >That is, the two quotation marks become a single bold quotation mark.

> I dislike condensing the doubled quote to a single quote as it would make
> printed code difficult to interpret unless a color printer was used or
would
> require that printed code be different than the screen code.

> Currently you can configure the colors used for strings -- if that setting
> either did not apply to the enclosing quotes or if a separate color
setting
> was available for string delimiters then people who want to see the
embedded
> quotes in a different color could do so and people who wanted it like it
is
> now could configure it that way.



Tue, 17 Jun 2003 05:34:42 GMT  
 Wish List: Embedded Quotes in VB.Net
Jonathan Allen:

Quote:
> The idea is that """" will be displayed as """ with the center one
> bolded (or a different color like you showed).
> That is, the two quotation marks become a single bold quotation
> mark.

   How do you handle the caret moving between the two quote characters that
make up the single bold quote? Doing a momentary split would be flickery and
distract attention when you are just moving through the string. Treating the
bolded quote as unbreakable would make it harder to fix typos as you are
typing the string.

   It would be better for more than one type of quote to be allowed as in
JavaScript. Maybe `these` or ?these?.

Bill McCarthy:

# BTW: I don't want the IDE having anymore to parse than is useful,
# so I can see no value in his suggestion, just cost.

   This looks to me like it could be done either with a very cheap
transformation applied in the late stages of drawing and measuring the text
or by substituting in a 'magic' character during lexing which would also
require little time.

   Neil



Tue, 17 Jun 2003 06:01:31 GMT  
 Wish List: Embedded Quotes in VB.Net

Quote:
>    How do you handle the caret moving between the two quote characters
that
> make up the single bold quote? Doing a momentary split would be flickery
and
> distract attention when you are just moving through the string. Treating
the
> bolded quote as unbreakable would make it harder to fix typos as you are
> typing the string.

How about only using it on lines that are not currently being edited?
Color worked that way in VB6.

--
Jonathan Allen


Quote:
> Jonathan Allen:

> > The idea is that """" will be displayed as """ with the center one
> > bolded (or a different color like you showed).
> > That is, the two quotation marks become a single bold quotation
> > mark.

>    How do you handle the caret moving between the two quote characters
that
> make up the single bold quote? Doing a momentary split would be flickery
and
> distract attention when you are just moving through the string. Treating
the
> bolded quote as unbreakable would make it harder to fix typos as you are
> typing the string.

>    It would be better for more than one type of quote to be allowed as in
> JavaScript. Maybe `these` or ?these?.

> Bill McCarthy:

> # BTW: I don't want the IDE having anymore to parse than is useful,
> # so I can see no value in his suggestion, just cost.

>    This looks to me like it could be done either with a very cheap
> transformation applied in the late stages of drawing and measuring the
text
> or by substituting in a 'magic' character during lexing which would also
> require little time.

>    Neil



Tue, 17 Jun 2003 07:09:58 GMT  
 
 [ 25 post ]  Go to page: [1] [2]

 Relevant Pages 

1. VB.NET Wish List for V.NEXT

2. Survery 20a: Version 2 Wish List: VB.Net

3. VS.NET 2.0 wish list

4. Wish list: new control for .net

5. VB.NET ODBC.NET limitations solved DSN list / Tables list

6. Wish List for VB.Next: Inline Docs

7. Wish List Vote: Eval Function for VB

8. VB 7 Wish List

9. VB 6.0 Wish List

10. Another VB 6 wish List or SP 4

11. VB 6 Wish list (restarted)

12. VB Wish List - vbwish@microsoft.com

 

 
Powered by phpBB® Forum Software