New C# Training Video Available

  • Thread starter Thread starter Wade.Beasley
  • Start date Start date
1) Looks good. Did you just use Camtasia to capture your whole session?
Did you use any post production tools or just Camtasia?
2) Your zip file is 18,700KB and your exe is 18,758 - giving you very little
compression and is mostly a pain cause I now have the 18Meg zip and the
18Meg exe. I would just publish the exe unless you can get more
compression.
3) Just a personal pref, but I would teach new users to do explicit tests
like "if ( mybool == true )" instead of "if ( mybool )" just to drive home
the point of what your testing for and self documents the code with no perf
impact that I know of. Cheers!
 
William Stacey said:
3) Just a personal pref, but I would teach new users to do explicit tests
like "if ( mybool == true )" instead of "if ( mybool )" just to drive home
the point of what your testing for and self documents the code with no perf
impact that I know of. Cheers!

I'd strongly disagree here - for the most part, if you name boolean
variables appropriately, the version without the "== false" or
"== true" ends up being more naturally readable. For instance, suppose
you have a variable "passwordCorrect". It's much easier to get from

if (passwordCorrect)

to the natural language interpretation of "if the password is correct"
than it is from

if (passwordCorrect == true)

Furthermore, with the latter version you also have the risk of
mistyping it as:

if (passwordCorrect = true)

which would be rather nasty and suggests using

if (true == passwordCorrect) instead, which is then even less readable.
 
I'd strongly disagree here - for the most part, if you name boolean
variables appropriately, the version without the "== false" or
"== true" ends up being more naturally readable.

That is true in many cases and depends on what your doing. However, many
times you use the same flag for both true and false tests depending on how
you access it in your methods. In that case, the explicit test can help
readability and remove "not" testing which can be confusing especially when
combined with other & or | testing in the same if block.
if ( !IsNum ) //Can be harder to understand espcially combined with other
tests, or when up all night :-)
or
if ( IsNum == false ) //Very plain and explicit.
if (passwordCorrect = true)
which would be rather nasty and suggests using

The complier (thankfully) gives you a little warning (underline) on this.

Obviously, in the end, everyone has their own style and views on what makes
sense to them. Wondrous diversity.

Happy Holidays!
 
Back
Top