Victor's book, Chap 2 – Alert! A discrepency is spotted!

Posted on

There is no possible way to actually get through and locate every single error and discrepency in a book. The hundreds of times the author and editors comb through the book and modify things – by the end, I’m sure the entire team feels dog-tired.

However, I’m someone going through the book and using it. My job is to be snobbish, accusatory and unappreciative, as well as blissfully ignorant of the high levels of iterations and reiterations that went into said book. Oh, and I’m supposed to say things like, “I could have spotted this from a mile away” or something to that effect.  I cannot forget the most important part: I must have a high level of grammatical and spelling errors to give a level of poetic irony.

I hate doing things that I’m “supposed” to do.

But I will point out 1 mistake/discrepency here and well – I’ll likely point out the others which I come across because its fun that I spotted it and its even MORE fun to tell that I spotted it.

Anyway, in Chapter 2 you’re requested on page 35 to modify your TextBlock size to w: 400px h:100px and in the screenshot of the program where you make these changes, the comments below the screenshot example read:

“Figure 2-19. Changing the Width and Height of your [TextBlock] to 400 and 100, respectively”

Then later, after modifying the foreground colors to be nearly jab-my-eyeballs-out gradients (sorry, I’m not a fan of the standard use of green-white-red gradients for the purpose of tutorials and teaching material. I find that practice to be abhorrent and if you’re going to really go after something that is easily observed, why not go all the way towards horrible colors instead of half way? Use neon pinks or something, it would match the book’s cover too! I hate pink, but going along w/ the theme presented from the cover, let’s take it home all the way, man!! Consistency! Consistency!), you encounter on page 38 the line:

“Because you set your [TextBlock] to the Width of 600 and a Height of 100…”

Wait, I did what?

I didn’t set my text block to a width of 600 – I set it to a width of 400. *twitch*

Ok, its fairly minor, but I’ll go ahead and change my TextBlock to 600 since you said that I already did. Maybe he’s just trying to use “The Secret” on the readers?

Edit: Just after posting this, I continued and almost immediately stopped because I was trying to as closely emulate his “lab” by using the same font-type.  He has in his picture the font-type of “Segoe UI”.  At first glance, that is likely not an issue.  However, when looking through my own listing of fonts, I’m finding that I don’t have said font.  I’m going to make a guess at where this font came from: One of his recent clients!!  I could be wrong, but w/ it having the label of “UI”, I would be willing to guess that this might be the name of the font which is named to assist with quick-reference, and “UI” designates where that font is used.  Woopsy!  The image of the font looks very very similar to Verdana but with slight modifications to make it almost DIN-Medium.

Chapter 2's "Hello World"

Posted on

Going through Victor’s book – chapter 2 is fairly short, but the “lab” at the end of it, the typical “Hello World” which is seen, as he mentions in his book, in most every book or introductory guide to programming, application development, and other types – is already a bit obsolete with the releases of later versions and updates to Blend.

Please note: His “Hello World” is not anywhere nearly as boring as many.  He goes through a lot of the basic orientational-use of Blend including gradients, modifying colors, color stop properties, application window resizing, key-frame animations, quick-key uses, and more.  Its more than worth going through.

In his book, he indicates that gradients start out left-to-right, and instead modifies things to go top to bottom.  Unless I’ve modified my default settings (which I don’t recall doing), mine is set exactly the opposite.  The “Gradient Brush” on mine starts from top to bottom, so several parts of the tutorial, including the very eye… catching *cringe* Christmas colored “Hello World”, which gradients from Red to White to Neon Green, will require you to rotate the gradient angle.   Remember, much like Adobe products, holding the shift-key down will maintain true-angles, which assists in obtaining an accurate rotation of exact 90¤.

I have to note that earlier, I asked the “Why?!” of the C: drive for locatino of projects.  I’m beginning to see why he has that as his choice.  For the purpose of this book, having everything held within a root “Projects” directory makes guiding those reading the book, quite easy.  Most who will be using this book who have different preferences will just place things wherever they want anyway, so it really doesn’t matter except for the use of guidance within the book where a person puts items, so long as they know where the file was placed.  Typical document saving 101.

Closing textblocks inside open tags

Posted on

From my experience, I always kick myself every time I do something like the following:

<TextBlock Text="Bogus Text" />

The reason I kick myself is that I find by closing a tag like this, I’m essentially shooting myself in the foot before I get very far.  If I close a tag now, within the same line as I open it, I run the risk of having to break it out, and then do a </TextBlock> later.

Yes, this is just an additional step, but if I have a whole lot of conditions within this, I’ll find myself losing my place very quickly.  Instead, I’ll seperate the command – for just in case.  It sets up the markup for future additions.


<TextBlock Text="Bogus Text">

Preparing for the future saves you on time later.  Oh – reasons I mention this – again, from Victor’s book.  He’s having you create, just to test the application to verify that Visual Studios created it without flaws, a simple Text Block with “FOO” as the text.  Yes, it’s there just to test the application and verify that its functional.  However, if you’re in the habit of always always creating things for the future, you hardly ever have to think about what you’re doing when performing something as simple as the creation of a textblock.  Those habits tend to pay off in the long run.  If you do things “the lazy way” most of the time, and properly only when the time calls for it, you’re likely to accidentally slip into your lazy mode and have to correct yourself every single time you put the fingers to the keyboard.

Need I mention this “right way now” mindset applies to every other aspect of life?

Disabling design view in Visual Studios

Posted on

For those that missed my blog earlier today, I am going through the Victor Gaudioso’s book on Blend 2, and one of the first things he has you do is create your application, not in blend, but in Visual Studios.  He makes quite a few valid points why he does it this way – the theme around these points centers around cleanliness of the markup and code – of which I can thoroughly identify with.  My greatest pet-peeve about coming into projects in the middle is that most things that I encounter are done half-*ss and sloppy instead of being done cleanly, properly, and legibly.  The typical user won’t see the code, but for those who will have to come in after the initial work is done, doing things correctly the first time, saves a company in the long run.

So before I get myself into even more of a rant on that note, I’ll stop myself and just say that I concur with Victor.  Cleaner is better.

The next thing he has you do is create the specific type of WPF application, move it to a c: directory folder (c:/ ?  Why?! ) and then goes into removing the design view by having you “Open with…” the document and open it in XML view.

… Why?

The easier way which allows you to retain the nice color distinctions which are by default – and in many cases, turned off when viewing in XML view – is to just click the little “-” button right above the designer.  Now, I’ll take it a step further and move the design view to nest below my code view, and then minimize, which just gives the ability to view if you click on the design tab.

Why go through the “open with”, which takes away a tiny level of functionality?  It may be tiny – miniscule, in fact, but I like that functionality, dangit!

So I’m skipping his step here.  For those who are interested in following me along on my trip through this book, I’d recommend that you just minimize the design view and have the code-view take up the screen.