Commenting in XAML is driving me nuts!!
-
You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
-
You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
chaiguy1337 wrote:
Another reason XML was not the best choice to base a language on.
It is what it is. Try commenting out the top half of a function in VB, see how well that works. At least XML has multi-line comments... XAML is still ugly as sin, but that's only partially the fault of XML.
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
-
chaiguy1337 wrote:
Another reason XML was not the best choice to base a language on.
It is what it is. Try commenting out the top half of a function in VB, see how well that works. At least XML has multi-line comments... XAML is still ugly as sin, but that's only partially the fault of XML.
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
-
Shog9 wrote:
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
:laugh::laugh::laugh: Where did you find that?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
chaiguy1337 wrote:
Another reason XML was not the best choice to base a language on.
It is what it is. Try commenting out the top half of a function in VB, see how well that works. At least XML has multi-line comments... XAML is still ugly as sin, but that's only partially the fault of XML.
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
Shog9 wrote:
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
:laugh::laugh::laugh: Where did you find that?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
Click the period. ;)
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
Ah, leave it to Pete to whip up a good one :)
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
Yet another reason XAML is complete and utter garbage. I do a lot of programming and I still can't believe MS thinks this is a good idea. My favorite 'feature' of xaml though is how easy it is to do loops.............
-
Click the period. ;)
----
You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.
Sweet. I didn't recognise it as one of mine. :-O You're right, and thank you for finally letting me hear this. :-D Ironically, when I saw your sig, I wished I'd been the one to say it.
Deja View - the feeling that you've seen this post before.
-
You can't just comment out any particular line, you need to comment out a whole balanced block of tags. No commenting out just an attribute, nooo. For that you just gotta delete it and hope you remember you did. Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments! Another reason XML was not the best choice to base a language on. :mad:
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
chaiguy1337 wrote:
Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!
You can't do this either in C# (or any other C based language), where the /* */ tags are used.
chaiguy1337 wrote:
You can't just comment out any particular line, you need to comment out a whole balanced block of tags.
Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).
Deja View - the feeling that you've seen this post before.
-
chaiguy1337 wrote:
Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!
You can't do this either in C# (or any other C based language), where the /* */ tags are used.
chaiguy1337 wrote:
You can't just comment out any particular line, you need to comment out a whole balanced block of tags.
Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).
Deja View - the feeling that you've seen this post before.
Pete O'Hanlon wrote:
You can't do this either in C# (or any other C based language), where the /* */ tags are used.
True, but C++/C# has // and VS has Ctrl+E Ctrl+C block commenting, which DOES support (and preserve) inner commented blocks.
Pete O'Hanlon wrote:
(if you don't mind)
Be my guest, if you can figure out how to do it! (Let me know what you come up with.)
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-
modified on Thursday, September 11, 2008 11:46 AM
-
chaiguy1337 wrote:
Oh and if you want to comment out a block that already has a comment? Forget it! XML doesn't allow the string fragment '--' within comments!
You can't do this either in C# (or any other C based language), where the /* */ tags are used.
chaiguy1337 wrote:
You can't just comment out any particular line, you need to comment out a whole balanced block of tags.
Hmmmm. Interesting. I'm following Karls lead and producing a PowerToy which contains features that I wish Cider had - I might just add this to the wishlist (if you don't mind).
Deja View - the feeling that you've seen this post before.
Hey Pete I came up with a way for your PowerToy to allow embedded comments in XAML, which is definitely something I would use. What you need to do is scan the block of text being commented for existing comments, and turn them into something non-commenty but that the tool can recognize later during an uncomment (and turn it back into a real comment). So the idea is if it's already commented, it won't matter that it's not legitimate xml, and only if the block is uncommented manually (without your tool) will it potentially pose an annoyance. In that case though it's probably better to have an error in the xml than to compile fine, because you don't want to inadvertently reinstate a piece of xaml that should otherwise remain commented-out. A secondary concern is to make it obvious an inner block is commented, perhaps by using visual obvious syntax like [/*[ comment ]*/] (something that's not likely to occur anywhere normally), or hey here's an even better idea: treat comments on a line-by-line basis like C#, then wrap any consecutive series of lines in a regular New Looks much better already don't you think! Now suppose you select the whole block and want to comment out the whole DockPanel. Well previously this would be impossible, but now I'm suggesting it should result in something like this:
-
Hey Pete I came up with a way for your PowerToy to allow embedded comments in XAML, which is definitely something I would use. What you need to do is scan the block of text being commented for existing comments, and turn them into something non-commenty but that the tool can recognize later during an uncomment (and turn it back into a real comment). So the idea is if it's already commented, it won't matter that it's not legitimate xml, and only if the block is uncommented manually (without your tool) will it potentially pose an annoyance. In that case though it's probably better to have an error in the xml than to compile fine, because you don't want to inadvertently reinstate a piece of xaml that should otherwise remain commented-out. A secondary concern is to make it obvious an inner block is commented, perhaps by using visual obvious syntax like [/*[ comment ]*/] (something that's not likely to occur anywhere normally), or hey here's an even better idea: treat comments on a line-by-line basis like C#, then wrap any consecutive series of lines in a regular New Looks much better already don't you think! Now suppose you select the whole block and want to comment out the whole DockPanel. Well previously this would be impossible, but now I'm suggesting it should result in something like this:
Good idea. It shouldn't be too hard (theoretically), and could be fairly easy to implement. But I certainly would want to implement something like this - it's something missing that should be there. I'll give the commenting out of the attributes some thought - there are a couple of ways that I can think of doing this, but they are hacks; nasty dirty hacks.
Deja View - the feeling that you've seen this post before.
-
Good idea. It shouldn't be too hard (theoretically), and could be fairly easy to implement. But I certainly would want to implement something like this - it's something missing that should be there. I'll give the commenting out of the attributes some thought - there are a couple of ways that I can think of doing this, but they are hacks; nasty dirty hacks.
Deja View - the feeling that you've seen this post before.
Lol yeah, I'm probably thinking some of the same things you are... like attached properties and "fake" attributes. ;) Anything is better than nothing though. Let me know if you come up with anything. Logan
“Time and space can be a bitch.” –Gushie, Quantum Leap {o,o}.oO( Looking for a great RSS reader? Try FeedBeast! ) |)””’) Built with home-grown CodeProject components! -”-”-