Programming Tutorial

(SINCEREST APOLOGIES FOR THE LAMENTABLE FORMATTING COURTESY OF WORDPRESS)

At long last:

  • Read: Programming (It’s a shitty article, but it introduces a lot of terms from a “technical” perspective, which will make them recognizable later in other contexts)
  • Read:  .NET Framework (Drill into the links if you like, or leave the window open and drill in later as necessary to maintain a superficial understanding of the terms involved [skim quickly and keep developing a cursory understanding of acronyms and layers {consider knowledge acquisition like combat – dance with the requirements of staying ahead of the curve <innovate meaning on the fly and demolish it later by the same process |someday you’ll understand: refactoring =reflect and simplify=|>}])
  • Simplify
  • Read: C# and VB.NET ([{<|=…=|>}])
  • Check Out:
  • (A.0) Do you understand, at least vaguely, what the following probably means?  (given the fact that “var …” is an expression that the computer recognizes as an instruction to create a place in memory to store the value that follows the equal (= or in) sign)
    • var x = new List<string>() {

      “string with an index of zero”,
      “jerome”,
      “the previous slot in the list held the textual representation of the name of a programmer”,
      “string-3”,
      “the index of this list element is 4 – but I bet you’d guessed that already”,
      “string-5”,
      “the fox jumped a fence just as understanding leapt a void”,
      “thinking at many levels at once, while still keeping them distinct, is the best way to proceed, methinks”

      };
      var y = 0; 
      foreach (var z in x) {
      	y = y + 1;
      	doSomething(z);
      }
      MessageBox.Show("Hey! user of this program that's running in your head (vaguely, maybe), there were {0} elements in the list named 'x'".Fmt(y));
  • (A.1) Does the following make more sense to you ?
    • var listOfLevelJumpingTextualContents = new List<string>() {
      
      

      “string with an index of zero”,
      “jerome”,
      “the previous slot in the list held the textual representation of the name of a programmer”,
      “string-3”,
      “the index of this list element is 4 – but I bet you’d guessed that already”,
      “string-5”,
      “the fox jumped a fence just as understanding leapt a void”,
      “thinking at many levels at once, while still keeping them distinct, is the best way to proceed, methinks”

      };
      var countOfTimesThroughLoop = 0; 
      foreach (var textContent in listOfLevelJumpingTextualContents) {
      	countOfTimesThroughLoop += 1;
      	doSomethingWith(textContent);
      }
      MessageBox.Show("Hey! user of this program that's running in your head, vaguely, there were {0} elements in the list named 'listOfLevelJumpingTextContents'".Fmt(countOfTimesThroughLoop));
  • How you would you describe the difference between the two previous examples?
  • The message to the user said that there were some number of elements in the list.  The number of elements in the list was assumed to be the number of times a textContent was created as the list was “interated“.  Does this make sense to you?
  • (A.2) Although it will seem stupid, can you articulate clearly what is the same and what is different between the previous two examples and:
    • var a = “string with an index of zero”;
      var b = “jerome”;
      var c = “the previous slot in the list held the textual representation of the name of a programmer – the one who typed these characters – over and over again (actually, he C & P’d them)”;
      var
       d = new List<string>() {

      a,
      b,
      c

      };
      var e = 0; 
      foreach (var f in d) {
      	e++;
      	g(f);
      }
      var k = "Hey! user of this program that's running in your head, vaguely, there were"
      var l = "elements in the list named 'd'";
      h.i("{0} {1} {2}".j(k, e, l)));
  • Whew!  There’s some code.  Especially that last line!  Abstraction galore!!!  You still with me?  If you aren’t, why?  If you are, why could someone not be?  Empathize with yourself or others.  What kind of brain habits does this stuff draw on?
  • What’re frickin’ patterns anyway?
  • Damnit!  There was a typo in (A.1).  Can you find it?!?  Are there any OTHER typos… ANYWHERE?  I dunno.  I’m hoping you can tell me.  We rest on our compilers.  Can humans be said to “compile” code in their head?
  • That typo happened when I renamed a variable after a copy and paste but forgot to cascade that change to one of the “instances” where it was referenced in the code fragment.  Do you think that description could ever make ANY sense to you?
  • Debugging is a reality of programming.  Debugging is frustrating.  Debugging is the stone that keeps kicking your toe.  Can you deal with it?  Can you learn to love the chaos?  Are you Neo?  Can you flow with & above the specific techniques required by one layer or another?
  • Bonus: Can you see that moving your fingers adaptively over the keyboard draws upon those same skills as devising an algorithm to solve a problem?  How can I move my fingers fastest over the keys given that my hand is structured so and so and my brain cognizes this way and that and the keyboard is flat like such and such…?
  • Programming involves a number of simultaneous concerns.
  • Some have said that understanding the assignment of a value to a named variable is the core essence of programming.  What’re other contenders for “core essence”?
  • [From: wikipedia]  The details look different in different languages, but a few basic instructions appear in just about every language:
    • Input: Gather data from the keyboard, a file, or some other device.
    • Output: Display data on the screen or send data to a file or other device.
    • Arithmetic: Perform basic arithmetical operations like addition and multiplication.
    • Conditional Execution: Check for certain conditions and execute the appropriate sequence of statements.
    • Repetition[iteration,loop]: Perform some action repeatedly, usually with some variation.

That concludes lesson 1.

Please, ask questions.  Asking questions of the appropriate oracle is an addendum to lesson 1.  Perhaps it be (choose wisely, least-cost first):

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s