While it is nice to have this it shows one core problem: you need a wizard/IDE plugin to solve a problem that would not even exist had it been addressed on the language level (multiline strings). And this is not the only case. Many cases where you need some IDE feature to generate code for you might be a case where the language itself could be improved to eliminate the need for code generation. #ceremonyversusessence
One small error: If you use a string like 'SELECT Customers.CustomerName, Orders.OrderID' + 'FROM Customers' + ... you ended up as 'SELECT Customers.CustomerName, Orders.OrderIDFROM Customers' + .... See the missing space between OrderID and FROM?
For that kind of modifcation i uses macros which contains also the jump to the next line, so i can hit the play macro button a dozen time and i am finished :)
I would like to see a multi-line string constant declaration (note the use of double quote " instead of single quote ' ):
SQL := " select x.* from TableX x right join ViewForY y on x.yref = y.id where y.Category = 1337 and x.Lovely = 1 ";
where the compiler do an implisitt white space normalization, replacing linebreaks and multiple spaces with single spaces, and removing leading and trailing spaces.
While it is nice to have this it shows one core problem: you need a wizard/IDE plugin to solve a problem that would not even exist had it been addressed on the language level (multiline strings). And this is not the only case. Many cases where you need some IDE feature to generate code for you might be a case where the language itself could be improved to eliminate the need for code generation. #ceremonyversusessence
ReplyDeleteOne small error:
ReplyDeleteIf you use a string like
'SELECT Customers.CustomerName, Orders.OrderID' +
'FROM Customers' + ...
you ended up as
'SELECT Customers.CustomerName, Orders.OrderIDFROM Customers' + ....
See the missing space between OrderID and FROM?
For that kind of modifcation i uses macros which contains also the jump to the next line, so i can hit the play macro button a dozen time and i am finished :)
I would like to see a multi-line string constant declaration (note the use of double quote " instead of single quote ' ):
ReplyDeleteSQL := "
select x.*
from TableX x
right join ViewForY y on x.yref = y.id
where y.Category = 1337
and x.Lovely = 1
";
where the compiler do an implisitt white space normalization, replacing linebreaks and multiple spaces with single spaces, and removing leading and trailing spaces.