Post: [C# Tutorial 2] General Understanding
05-11-2012, 02:25 AM #1
Pichu
RIP PICHU.
(adsbygoogle = window.adsbygoogle || []).push({}); C# Tutorial 2 – General Understanding

At first you may find that the interactive portion of the software is overwhelming but quickly you will learn that it is very simple so let's get you started.

First load up the program. When it has fully loaded you will notice that your screen looks very similar to the one below.

You must login or register to view this content.

At the top, click or hover on Tools, then click Settings and select Expert Settings.

You must login or register to view this content.

This will modify how everything appears.


Go ahead and click "New Project".

You must login or register to view this content.

You will notice 6 different options to choose from.



  1. Windows Forms Application is for creating applications. It starts you off with a basic Form that allows you to add options and to code on. Often enough, people may refer to the Form design as UI or User Interface.
  2. WPF Application is for creating client related applications.
  3. Console Application is for creating Command-Line applications. This is similar to Batch however written in C# language. It allows for Output and Input like Batch and uses the CMD window.
  4. Class Library is for creating (.dll) – You can use this in a program to clean up the code. If you are dealing with a program that has over 10,000 lines of code a class might be used in order to help separate events. They also be used if you have a team. Rather than having to update each and every time someone wants to add something, you can have one work on a different class and compile them together in the end to achieve the same output.
  5. WPF Broswer Application is like that of a WPF Application but requires .NET Framework 3.0 or above in order to run.
  6. Empty Project is an Empty Project.


Go ahead and just rename this to "Tutorial1" and ensure that Windows Forms Application is Highlighted. Then go ahead and click "OK".

You should now see something very similar to this.

You must login or register to view this content.

Press CTRL+W and then press p. This will give you the properties window.

You must login or register to view this content.

Expand the toolbox on the left part of the screen and click the pin in order to lock it. You may drag and resize the different windows to how you like it by click next to the window names.

You must login or register to view this content.

In the Properties box you will have these as options. Change it so it looks like mine.

You must login or register to view this content.

Now, you will notice everything is categorized, either way works as it is all preference. Categorized just makes it easier to identify what does what.
The content on the left side indicates the value name. On the right indicates the current value given. Blank = No value.
When you change something, you change the Form connected to it. You may rename a Form here, change the Form's properties.

A simple exercise will be to do this.


  • Change the BackColor to ActiveCaption
  • Change the Forms Text to Techplus.com
  • Change the size to 500,450. (This is represented in X and Y or Width and Height.)
  • Change Maximize Box to False



When you are done, it should look like this.
You must login or register to view this content.

Now double click the form where the title is anywhere. A new menu should open up. This is where you will enter in the code for the program.

You must login or register to view this content.

Now, what you see in this menu is the main coding for how the program works, this is also known as a .Class file (EG. Name.cs)

Now, up at the top of the menu you will see a Green Arrow facing right. Click that and it will debug your application. You may also press F5 To achieve the same results.

When you do so, you should get this.

You must login or register to view this content.

Now press the blue square in order to end the debug session.

To save the application, simply go to File > Save All and then name it.

Congrats, you have just created and saved your first application!

Originally posted by another user
This is taken off from my website, the website is free and is designed only for tutorials. I will posting tutorials I create for my site here as well. Link is in my signature.

The following user thanked Pichu for this useful post:

caleb01
05-11-2012, 11:02 AM #2
Good job. It is very organized and is a high quality post. Just a quick question though. Why didn't you put these all in one thread and use the multiple page option? Would of made it easier to find all your C# guides in one place, rather than having to hunt around for them.
05-11-2012, 12:12 PM #3
caleb01
Little One
Yes I agree with magicalmonkey...I dont think these should be in seperate threads. Great posts though.
05-11-2012, 10:27 PM #4
Epic?
Awe-Inspiring
While well organized and well written, there are a number of technical inaccuracies.
05-11-2012, 11:17 PM #5
Pichu
RIP PICHU.
Originally posted by caleb01 View Post
Yes I agree with magicalmonkey...I dont think these should be in seperate threads. Great posts though.

Yea. Smile
Originally posted by Epic
While well organized and well written, there are a number of technical inaccuracies.


May you point them out so I can fix. Smile

(This was quickly written in my spare time so, :/)
05-12-2012, 04:47 AM #6
Epic?
Awe-Inspiring
Originally posted by Sublimity View Post

May you point them out so I can fix. Smile

(This was quickly written in my spare time so, :/)


Now, I'm not sure what level of programmer this tutorial is targeting, but assuming it's meant to be introductory, I'd consider teaching C# as a first language to be a bad choice. That aside, here are some points I noticed (from the three of your tutorials posted as of this time):

From your first tutorial:

  • C# is multi-paradigm.
  • You mention computing-power. C++, C#, Visual Basic, and all computationally universal programming languages have the same amount of computational ability. I've also never heard of a language described by its "computing-power", but rather, computers.
  • ".Net" is actually ".NET"
  • Your installation time might be slightly (or very) off. I have installed Visual Studio on both my laptop and desktop (although they are relatively new and of high quality), and it has taken no longer than a few minutes.
  • When describing the C# language, you mentioned a few points that attempted to describe the language, but you failed to ever describe the core features (or perhaps, distinctions) of the language (such as paradigm, type system, major implementations aside from Microsoft's Visual C#, etc.).
  • Assuming this tutorial is for beginners - how many of them know what SOAP, XML, or even object-oriented programming is?
  • Two points you mentioned were XML and SOAP, but you never described what they were, or how they were used in programs (specifically, programs written in C#).




From your second tutorial:

  • A WinForms application isn't just for "creating applications" - it's specifically for creating forms (effectively a GUI). A "UI" doesn't necessarily translate to a "GUI".
  • A WPF application is effectively the next generation of WinForms. It's also built for making GUIs, it's just more modern, and employs a different (possibly better) method of designing GUIs than WinForms. I'd suggest you teach WPF as opposed to WinForms, there's not much sense in teaching outdated technologies.
  • Not really a problem, but you didn't make "Console Application" bold in your list of options.
  • A Console Application is designing for creating applications that run from a console window (which is only somewhat synonymous with "command-line application"). Console applications are not the same as Batch, they are not related to Batch. I think it's a bad comparison.
  • A Class Library is for creating a library of classes, not explicitly a DLL. It's not used to clean up code, it's used to store and organize classes (which are code).
  • You don't necessarily want to break up a program into a class library without good reason. You should use it when you're developing a library - not when you want to break up your program.
  • Class libraries are not used to separate events.
  • Class libraries should certainly not be used for teamwork! If you need to work with a team (whether remote or in the same room as you), you use modern communication tools, software configuration management tools, and ideally a defined (or series of defined) development methodologies. You do not use class libraries.
  • You missed the core distinction of a WPF browser application: it runs in a (client's) web browser, and requires the client to have .NET 3.0+.
  • Please make them rename forms! Start building good habits early.




From your third tutorial:

  • Please, make them rename components!
  • ".Text is defining the value in which we are invoking" hardly makes any sense. See broad criticisms. You've jumped into properties without explaining what properties are.
  • When double quotation marks wrap a portion of text, the text is handled as data (of the string literal type), rather than code. Side note: for new programmers, you never explained what a string was.
  • = is the assignment operator (please give the real names of things early on, it makes them easier to discuss later).
  • Your note about = vs == isn't relevant, because they know nothing about logical operations or statements.
  • You just breezed right over event driven programming.



Broad criticisms:
Your tutorial, at least up until this point, is not focused on C#. It seems to be focused on .NET, Visual Studio, and (especially) WinForms. While all are useful tools when developing in C#, they have little bearing on the C# language. By jumping directly into WinForms, you've failed to teach core, necessary constructs - you've simply begun using advanced tools and programming techniques (without explaining the tool or technique). You've offered no clear explanations about core programming concepts, and have only demonstrated "flashy" things, things that ultimately don't bear relevance in programming. You've also failed to explain and define certain terms of concepts that would not be understood by a truly new programmer.

I may have missed a few points, if you'd like me to give more examples, I'd be happy to. Don't take this the wrong way, I'm not trying to bash your tutorial. Like I said, it's mostly well written, and is quite well organized. There are a few technical errors. There are a few flaws in your teaching methodology. Of course, there are frequently minor technical errors in learning resources - even professional ones. I'd be most concerned about the teaching methodology.

The following user thanked Epic? for this useful post:

Pichu

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo