In chapter 8, the book guides you through creating a window which allows you to drag a movie into the window, it displays the path, and when you click “ok” to make the window which displayed the path disappear, the video starts playing.
To do this, we set in the C# a URI variable, named it uri, and did a few other things. The application ran as intended – the video played.
But besides making it easy for the readers of the book, I could see quite quickly where naming a URI the name “uri” would get confusing when trying to debug something.
What if you’re jamming (which is what I call it when I’m on a roll and making things work the way I’m wanting w/o any hitch) and you’re just needing to modify something, and woopsy – modified the wrong one because you have the same dang thing written one after the next? Or what if you’re trying to find where you’d inadvertently modified the URI, and because you’re seeing the name “uri”, you don’t initially realize that its the name, not the variable.
*shakes head* Seems like something that might be considered as “preparing one’s self to shoot self in the foot.” Like taking your shoes and socks off so as to give yourself a clear shot.
Perhaps there’s more of a reason for naming a URI uri, or perhaps its just not an issue as its such common practice. This would be the first time that I’m working with C# that’s being put into place by me as opposed to locating someone else’s example code or modifying something that I’d used in the past or seen used in a previous project that worked.
Leave a Reply