Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jan 2011
    Location
    Basel, Switzerland
    Posts
    13

    C# 101: Absolute Beginner Resources

    I thought I would open up a thread for those of us "absolute beginners" in the C# 101 class starting Wed 4/24/2013. Yesterday there was a lot of vocabulary, and I for one am going to do a bit of research to try to sort it all out. I'll try to post my own documents here, and please if there are personalized cheat sheets out there, please help us .

    For now, here is a few quick links for those of us "newbies":

  2. #2
    Join Date
    Jun 2007
    Location
    Denmark
    Posts
    16

    Thumbs up

    Thank you for the link Eudaimon, much appreciated.

    After attending the Class yesterday I also find myself wanting to explorer more of the vocabulary used, so my foundation for learning C# is rock solid.

    /JR

  3. #3
    Join Date
    Apr 2013
    Location
    Ponyville, Equestria
    Posts
    17
    Nice to know I'm not the only complete newbie trying this class out.
    Last edited by Kirito; 09-05-2013 at 01:28 PM.

  4. #4
    Join Date
    Aug 2010
    Location
    In my room.
    Posts
    748
    Also the XNA 101 Hyperion Project is a nice set of videos right here on 3DBuzz available for free.
    I'm so negative, like an electron.

  5. #5
    Join Date
    May 2011
    Posts
    95
    A bit of advice I could give, is document your code with comments. This is especially crucial when beginning programming. It is important to draw those connections between the English language (or your native language) and a programming language. I have found that a good way to document my code is by writing pseudo-code first, and then each programming line I write, I take one of those lines from the pseudo-code and place it before the new programming line. Here is a very simplistic example, but note that this works better with more complicated code:

    Problem:
    Write a program to add two numbers together, and print the value.

    pseudo-code(written first in the program as comments):
    Code:
    // Allocate memory for an integer to hold first value.
    // Allocate memory for an integer to hold second value.
    // Allocate memory for an integer to hold the sum of the two values.
    // Assign the sum of the two values to be equal to the value of the first value added to the second value.
    // Print the sum of the two values.

    Start Writing the Code(taking each of those lines one at a time):

    1.
    Code:
    // Allocate memory for an integer to hold second value.
    // Allocate memory for an integer to hold the sum of the two values.
    // Assign the sum of the two values to be equal to the first value added to the second value.
    // Print the sum of the two values.
    
    // Allocate memory for an integer to hold first value.
    int mFirstNumber = 10;
    Then go to step two. Notice that the first step in our pseudo-code has been used.
    2.

    Code:
    // Allocate memory for an integer to hold the sum of the two values.
    // Assign the sum of the two values to be equal to the first value added to the second value.
    // Print the sum of the two values.
    
    // Allocate memory for an integer to hold first value.
    int mFirstNumber = 10;
    
    // Allocate memory for an integer to hold second value.
    int mSecondNumber = 5;
    Continue this process, taking each step from your pseudo-code and implementing it.
    Code:
    // Allocate memory for an integer to hold first value.
    int mFirstNumber = 10;
    
    // Allocate memory for an integer to hold second value.
    int mSecondNumber = 5;
    
    // Allocate memory for an integer to hold the sum of the two values.
    int mSumOfTwoNumbers = 0;
    
    // Assign the sum of the two values to be equal to the first value added to the second value.
    mSumOfTwoNumbers = mFirstNumber + mSecondNumber;
    
    // Print the sum of the two values.
    Console.writeLine(mSumOfNumbers);


    Writing code like this may take longer, but when you look back at your code you will know EXACTLY what you did and it also helps bridge that connection between your spoken language and the programming language. This technique I used heavily when writing AI algorithms for one of my classes. In more complex algorithms it also helps to make sure you don't miss any steps.

    Happy Coding!! I may pop in from time to time with more advice
    Last edited by frostbytes89; 04-26-2013 at 06:03 PM.

  6. #6
    Join Date
    Oct 2011
    Posts
    547
    Quote Originally Posted by frostbytes89 View Post
    ...pseudo-code(written first in the program as comments):....
    I think that doing it this way is a bit hazardous in the sense that it shapes and reinforces the mind into thinking procedurally. It might work now and give confidence for beginner programmers but it will be, imho, an impediment later on when shifting to another style that is ever present (esp in C#).

    @Kirito
    Afraid to ask but why only 20% cooler?
    Last edited by florem; 04-27-2013 at 06:25 AM.

  7. #7
    Join Date
    Jun 2012
    Location
    probably at a PC
    Posts
    309
    I have to agree with florem.

    Granted, I also tried working with comments at first, but I very quickly found it to be slowing me down too much. Sometimes so much so, that I lose my train of thought.

    I'm far from an accomplished programmer, but the only comments I currently place are placeholders for future code and on complex(er), finalized methods I use the /// method-description/documentation type of comment above the method itself. And even then, mostly only for methods that are public and server an important role. I rarely still find use for comments inside of methods/algorithms unless I'm testing different approaches with new features (during testing phase). Those comments will disappear once I've settled on an approach.

    I pretty much found that after 101 (starting 102 throughout 103), the term "comments" got a new meaning for me (personally).

    I'm sure it's useful at the beginning, but don't force yourself to keep commenting everything, in particular stuff that you know inside-out. Comments should be reserved for complex(er) stuff you need to be able to understand quickly when looking back at it after weeks/months. I suppose I've come to agree with Nelson when I say, code should be written in a way you can understand it without adding lots of notes to it and if your code needs a lot of notes, it might not be written very well.

    Just my thoughts.
    Last edited by nGAGE; 04-27-2013 at 09:14 AM.

  8. #8
    Join Date
    Oct 2011
    Posts
    547
    @nGAGE
    My previous post was not related to comments per say.
    It was related more to how you start and break a problem up.
    Solving it in a top down or procedural manner has its benefits with smaller programs because it's quick and easy.
    However, once the complexity rises the procedural approach is, for me at least - in comparison with oo-, somewhat daunting.

    Solving problems in procedural manner is good when starting out but shouldn't be awarded more attention by teaching yourself that coding should be done as a cascading todo list. (make a -> make b -> make c -> take a and take b -> place in c -> done).

    As for the commenting in general, each to their own. Like you, in the past I saw them as necessary, but after seeing Nelson's coding style and aspiring a bit to it I found it more agreeable. Meaning that time spent on good comments was redirected to good naming.

    PS1: Thinking about how this is a beginner programming thread maybe my earlier and this post weren't all that merited.
    PS2: If you are a beginner, reading this and feeling a bit overwhelmed, don't be.

  9. #9
    Join Date
    Jun 2012
    Location
    probably at a PC
    Posts
    309
    @florem
    My mistake. I assumed you were referring to commenting, not thinking beyond that tbh. Aside from that, I once more have to agree though, including the PS's. :P

  10. #10
    Join Date
    May 2011
    Posts
    95
    Hmm, I suppose I didn't communicate my idea clearly enough and it is causing a lot of misunderstandings. I assumed this was a thread for absolute beginners, which I defined arbitrarily as somebody who has no idea what say, an "int" is. So I assumed that method of commenting might be useful at first to him. However, of course it is silly to write comments like that for such trivial pieces of code. I meant for it only to be a methodology to help the learning process when a student is first learning things like keywords, and even then, the example code is just that - an example.

    As far as procedural coding, again, that post was for absolute beginners - somebody who has not yet reached the ability to write complex programs and who will not have a need for a cascading todo list because he is unaware of what a function is. But yes, you are right. More advanced programmers should start with a todo list containing certain tasks that their program should be able to accomplish. So, say if I needed to write a calculator program, I might list all of the tasks, or functions, my program would need to carry out. However, actually filling out the individual function is obviously a procedural affair.

    But anyway, that's just what I found useful back in the day when I was starting years ago

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •