Quotes for literal strings

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Quotes for literal strings

Post by Dude »

This is so messy to read:

Code: Select all

Debug ~"\"Hello World\""
Wouldn't it be cleaner to use \q instead, like this:

Code: Select all

Debug ~"\qHello World\q"
What do the masses think?
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: Quotes for literal strings

Post by kenmo »

I agree! +1
No big reason, just \" makes strings less readable than \q.

Obviously the team wouldn't REMOVE \" but it would be nice to add \q as an additional escape.

This wouldn't break ~"\q" in existing code, because ~"\q" currently raises a compiler error.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Quotes for literal strings

Post by wilbert »

A lot of computer languages use \" .
It would be confusing to use some none standard alternative.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply